Postfix - Howto Relay email

I have setup a howto for getting email relaying working with Postfix. This is handy if you run a home internet connection that blocks your voicemail emails. Hope this helps someone out.

http://www.otherdata.com/blog/email-relaying-freepbx

Hey thanks for the script. Are you saying I just wasted 4 hours of my day figuring this out!!! hahaha.

Looks like you are missing the configuration of the SSL stunnel though, stunnel hosts.allow configuration, and some important Postfix options though?

Nice job on typing that out but that is a long way of doing things. Just put the following into a script and run it. It will setup postfix to relay to whatever mail server you put in place of the server name.
mail.example.com is the name of the server to send to.
366 is the port number to use.
[email protected] is the email address.
password is the password of the account.

Start of script, Do not put this in

echo “mail.example.com:366 [email protected]:password” > /etc/postfix/sasl_passwd
chown root:root /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
postconf -e 'relayhost = mail.example.com:366
postconf -e 'smtp_sasl_auth_enable = yes’
postconf -e 'smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd’
postconf -e ‘smtp_sasl_security_options =’
/etc/init.d/postfix restart

End of script, Do not put this in

No, You did not waste your time. Your way is fine if you want to setup a tunnel directly to your server. The way I setup is to allow the postfix server to contact a server of your choice with a valid username and password. Most common is ATT. They allow only mail sent through their server on the standard port 25. If there is another port to use to a different server then you can setup using the way I described aboved. It will do the work of what you did in webmin. The ssl tunnel I have never needed. I alway point the postfix servers to my mailserver. Either way will work.

So does the way you used support SSL?