Postfix relayhost

Submitted by freelock on Mon, 01/11/2010 - 10:18

These are the basic steps to set up Postfix to use SMTP Authentication to send mail through a relay host.

  1. Set up a password maps file (/etc/postfix/sasl_passwd) as follows: username:password
  1. chown root:root /etc/postfix/sasl_passwd; chmod 600 /etc/postfix/sasl_passwd
  2. postmap /etc/postfix/sasl_passwd
  3. In /etc/postfix/
relayhost =
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
  1. postfix reload

Also, if this is the first SASL service installed on the machine, make sure there's an appropriate SASL plugin installed:
  1. urpmi --media main libsasl2-plug-login libsasl2-plug-plain

That should do it! Postfix will log into the relay host using the smtp auth username and password. It's possible to set different logins for different servers, by adding more lines to the map file. Security options must be cleared to allow plaintext logins.