Sending email with Comcast and Postfix

I do a lot of development work from my laptop, set up a lot of web apps to run on localhost. Most thing work fine, but I had trouble sending email. Getting email to send correctly is a simple process.

If you’re using postfix as your MTA (and you should be) edit file main.cf. In OS X 10.6.4 it’s here:
/private/etc/postfix/main.cf

Let postfix know you want to send email to an SMTP server using name and password.
relayhost = [smtp.comcast.net]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
smtp_sasl_security_options =

Then put your username and password in this file:
/etc/postfix/sasl/passwd

I had to contact Comcast support since I’ve never accessed my email. The file should look like this:
smtp.comcast.net username:password

Then set permissions and reload the file:
chown root:root /etc/postfix/sasl/passwd;
chmod 600 /etc/postfix/sasl/passwd
postmap /etc/postfix/sasl/passwd
postfix reload

One last thing. To keep email out of the spam folder, you should change the hostname to match the hostname of your Comcast modem. To find that, go here:
http://www.whatismyip.com/tools/ip-address-lookup.asp

Then put that value in your main.cf.
myhostname = myhostname.comcast.net

Then reload postfix and send yourself a test email.

Leave a Reply

Your email address will not be published. Required fields are marked *