PostFix per Username Authentication
To use an authenticated user:
- Create a password maps file, for example
/etc/postfix/relay_passwd
: - Ensure the file has the correct permissions and to create the hash from the maps file by executing the following commands:
- chown root:root /etc/postfix/relay_passwd
- chmod 600 /etc/postfix/relay_passwd
- postmap /etc/postfix/relay_passwd
- Add the following line to
/etc/postfix/main.cf
- Finally add the following to
/etc/postfix/main.cf
below the relayhost = line: - Restart Postfix for the changes to take effect using
/etc/init.d/postfix restart
smtp.smarthostname.demo-domain.invalid USERNAME:PASSWORD"
relayhost = SMARTHOST:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd
smtp_sasl_security_options =