This post is really just a reminder for me, as I’ve needed to configure postfix to authenticate through an ISP SMTP server a few times in the past. Each time I’ve wasted time re-googling the correct postfix configuration settings to use, so I’ve decided to stick it on here for the next time I do it.
For this example, I’m assuming that mail.btinternet.com is the ISP relay server, firstname.lastname@example.org is your email address and you’ve set up DNS entries so that emails sent to email@example.com are delivered to your postfix server.
Edit /etc/postfix/main.cf and add the following lines:
relay_host = mail.btinternet.com
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
Now create the /etc/postfix/sasl_passwd file and add the following contents:
Create the db file with the following command:
Reload postfix with:
Finally, verify your account with BT by logging onto your BT webmail and clicking Options > Mail Options.
Click Accounts > Add or Edit an Account.
Click Add and provide an account name.
Click continue, then provide your name and email address (your postfix email, not your BT email).
Click continue, then click Skip this Step (as you don’t need BT to relay inbound emails).
Click Send Verification.
Your postfix server should receive an email with a verification code. Enter this into the final BT webpage and that should be it.