{{tag>[linux alpine mail imap ssl]}} ====== Alpine 2.20 - Configuration for CentOS 7.x====== ===== Compile with TLS certificate support ===== ==== Prerequisites ==== * Install development tools (on CentOS 7: yum groupinstall development tools) * Install additional dependencies:yum install ncurses-devel openssl-devel pam-devel * Create SSL certificate directory:mkdir -p /usr/local/etc/ssl/certs ==== Install Alpine 2.20 ==== * Download the [[http://patches.freeiz.com/alpine/release/|latest Alpine version]] * Decompress the archive: tar -Jxf alpine-2.20.tar.xz * Compile Alpine:cd alpine-2.20 ./configure --with-ssl-certs-dir=/usr/local/etc/ssl/certs make * Install Alpine:sudo make install ==== Configure mail server certificates ===== * Copy your mail server certificate to: /usr/local/etc/ssl/certs/imap-mailserver.pem * Create symlink with 8 digit hex hash: cd /usr/local/etc/ssl/certs cert=imap-mailserver.pem ln -s $cert `openssl x509 -noout -hash < $cert`.0 * Now do the same for the CA and intermediate certificates. ===== Configure Alpine ===== ==== Setup remote config ==== You can save your config in a remote IMAP folder so that you can use the same config on other locations. * Got to RemoteConfigSetup: m -> s -> z * Convert addressbook to a remote addrbook? **y** * Convert signature file ".signature" to a literal sig ? **y** * Remove local addressbook: m -> s -> a, choose .addressbook, press **d**, then **both** * Create alias to start alpine:#Add line below to ~/.bashrc alias alpine='alpine -p "{mail.server.tld/user=your@emailaddress.com/ssl}remote_pinerc"' === Configure IMAP / SMTP with TLS === Setup configuration m -> s -> c * Personal name: Your name * User domain: Your domain * SMTP server: mail.server.tld:587/tls/user=user@name * Inbox path: {mail.server.tld/user=user@name/ssl}INBOX * Default Fcc: {mail.server.tld/user=user@name/ssl}Sent * Customized headers: From: Personal Name Setup imap folders m -> s -> l -> a * Nickname: name * Server: mail.server.tld/user=user@name/ssl === Configure S/MIME === * Create directory structure:mkdir -p ~/.alpine-smime/{ca,public,private} * Copy public key to in ~/.alpine-smime/public, filename like: mailaddress@domain.com.crt * Copy private key to in ~/.alpine-smime/private, filename like: mailaddress@domain.com.key. If you have not encrypted your private key, do it now:openssl rsa -aes256 -in server.key -out newserver.key