This page explains how to configure Postfix on a Debian system to send mail through another mail server that requires a username and password. The motivation for this document is my frustration for the lack of a complete document explaining this simple and common setup.

So here goes…

  • Install Packages
  • apt-get install postfix libsasl2-modules

  • Configure
  • Insert the following lines:
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_use_tls = yes
  • Create password file
  • echo “ myusername:mypassword” > /etc/postfix/sasl_passwd
  • postmap /etc/postfix/sasl_passwd

  • Restart Postfix
  • /etc/init.d/postfix restart

  • Test