Example of postfix configuration with SSL encryption enabled¶
To configure email delivery with SSL encryption you need to make the following changes in the postfix configuration files:
/etc/postfix/main.cf- file should contain the following entries in addition to standard (unchecked entries):mydestination = $myhostname, localhost.$mydomain, localhostmyhostname = example.comrelayhost = [smtp.example.com]:587smtp_sasl_auth_enable = yessmtp_sasl_password_maps = hash:/etc/postfix/sasl_passwdsmtp_sasl_security_options = noanonymoussmtp_tls_CAfile = /root/certs/cacert.cersmtp_use_tls = yessmtp_sasl_mechanism_filter = plain, loginsmtp_sasl_tls_security_options = noanonymouscanonical_maps = hash:/etc/postfix/canonicalsmtp_generic_maps = hash:/etc/postfix/genericsmtpd_recipient_restrictions = permit_sasl_authenticated
/etc/postfix/sasl/passwd- file should define the data for authorized*`[smtp.example.com\]:587 [[USER@example.com:PASS]](mailto:USER@example.com:PASS)`*
You need to give appropriate permissions:
*`chmod 400 /etc/postfix/sasl_passwd`*
and map configuration to database:
*`postmap /etc/postfix/sasl_passwd`*
next you need to generate a ca cert file:
*`cat /etc/ssl/certs/Example\_Server\_CA.pem | tee -a etc/postfix/cacert.pem`*
And finally, you need to restart postfix
*`/etc/init.d/postfix restart`*