Setup pop3 and smtp auth on linux


Just a rough guide to getting a more secure mail server working on amzn or centos linux..

Use yum to..
install dovecot for pop/imap
install cyrus-ssl saslauthd
install sendmail and sendmail-cf if not already installed

rm -f /etc/pki/dovecot/private/dovecot.pem /etc/pki/dovecot/certs/dovecot.pem
vi /etc/pki/dovecot/dovecot-openssl.cnf
/usr/libexec/dovecot/mkcert.sh

vi /etc/pki/tls/certs/make-dummy-cert
cd /etc/pki/tls/certs
./make-dummy-cert sendmail.pem


create a user account (useradd username)

add domain to /etc/mail/local-host-names # each domain & subdomain that needs to accept mail should be listed here

add @domain username to /etc/mail/virtusertable # sends all mail for this domain to username (if you want!)

edit /etc/mail/sendmail.mc and comment/uncomment/edit the relevant lines to enable ssl/smtps etc. and any other options you want, then rebuild with /etc/mail/make

service dovecot restart
service sendmail restart
service saslauthd restart

  Tags:

Looking for great online sysadmin training in Linux, Security & Hacking and many others?

Back