If you’re looking to use Postfix in a configuration where it will relay to PostageApp as the upstream you’ll need to make a few small adjustments to the default Postfix configuration.
The first step is to define the relayhost
in /etc/postfix/main.cf
:
relayhost=[smtp.postageapp.com]:487
Then enable TLS in /etc/postfix/main.cf
:
smtp_tls_security_level = encrypt
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwords
smtp_sasl_security_options =
This breaks down as:
smtp_tls_security_level
directive forces TLS on all outbound connections.smtp_sasl_auth_enable
will enable SASL logins on connections.smtp_sasl_password_maps
will specify where the passwords are stored.smtp_sasl_security_options
is supplied to specify the options, though none are required.The /etc/postfix/sasl_passwords
file needs to contain the username/password
combination for the associated PostageApp account. It’s in the form of:
[smtp.postageapp.com]:487 account:API_KEY
Where account
is short account name and API_KEY
is the associated API key.
This information is listed on your Mail Servers page for any SMTP-enabled
mail server.
After this file’s saved you’ll need to convert it to a Postfix database with:
postmap sasl_passwords
Then test that Postfix is properly configured:
postfix check
If there’s no errors then a reload
should work:
postfix reload
That should pick up the configuration changes.
When encountering delivery issues, check /var/log/maillog
where Postfix
logs activity and errors, as well as mailq
to see what backlog exists
and what problems are preventing it from being delivered.
When encountering this error, check that the SASL libraries are installed. These may not be installed by default. For RedHat derived distributions, including CentOS:
yum install cyrus-sasl{,-plain} libsasl2-modules