Friday, July 10, 2009

Getting postfix to relay mail through authenicated SMTP

If you're like nearly everyone out there, your home computer network has port 25 blocked by your ISP. Sadly this means that you can't easily use postfix or sendmail to deliver messages. They just pile up in your mail queue.






I have replicated the info here because it's so useful that I don't want to lose it if that link ever goes dead.


  1. Call your ISP and get your email credentials for SMTP. Typically you'll need the SMTP server, username, password, and port number.


  2. Edit /etc/postfix/main.cf:

    relayhost = [smtp.comcast.net]:587
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
    smtp_sasl_security_options =



  3. Create dir /etc/postfix/sasl if needed then edit file /etc/postfix/sasl/passwd:


    smtp.comcast.net myusername:mypassword



  4. Fix permissions:

    chown root:root /etc/postfix/sasl/passwd;
    chmod 600 /etc/postfix/sasl/passwd
    postmap /etc/postfix/sasl/passwd
    postfix reload



That's it! Blissfully perfect sendmail from now on.

0 comments:

Post a Comment