Postfix Satellite configuration: Remote SMTP with auth

If you have ever run into the problem that your computer will not send e-mails directly, then this might help.

Install Postfix and configure it as a satellite server. This was done on a Ubuntu desktop installation, so I don’t know what Fedora and co. will say.

In the /etc/postfix/main.cf file add or modify the following lines:

relayhost = smtp.gateway.ch
smtp_sasl_auth_enable = yes
smtpd_tls_auth_only = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous

This configures postfix to relay all e-mails over the defined host. Now the sasl_passwd file must be created with the credentials for the SMTP gateway:

smtp.gateway.ch user@gateway.ch:password

Now create the map of the password file and reload postfix:

sudo postmap /etc/postfix/sasl_passwd
sudo /etc/init.d/postfix reload

Test the configuration by sending a test e-mail:

echo -e "From: someone@somewhere.ch\nTo: some@otherplace.com\nSubject: Hello World\n\Body: \nHello beautiful world" | sendmail -t

And see what postfix said:

tail /var/log/mail.info

Have fun!