Saturday, March 8, 2014

Switching Fedora 20 sendmail from port 25 to port 587

My fedora server sends outgoing email to smtp.comcast.net.  I've always been able to configure that with just this in /etc/mail/sendmail.mc:

define(`SMART_HOST', `smtp.comcast.net')dnl

But two days ago Comcast finally started blocking port 25 on me (http://customer.comcast.com/help-and-support/internet/email-client-programs-with-xfinity-email/).

There are quite a few posts and articles about switching to port 587.  Below is what I found worked on my Fedora 20 server.

Step 1.  New /etc/mail/sendmail.mc config setup:

define(`SMART_HOST', `smtp.comcast.net')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
FEATURE(authinfo)dnl

Step 2. Setup authinfo

Assuming your comcast account is walrushose@comcast.net with password door123 ...

# touch /etc/mail/authinfo && chmod 600 /etc/mail/authinfo
# echo 'AuthInfo:smtp.comcast.net "U:walrushose" "P:door123" "M:PLAIN"' > /etc/mail/authinfo
# makemap hash /etc/mail/authinfo < /etc/mail/authinfo
# chmod 600 /etc/mail/authinfo.db

Step 3. Remake and restart sendmail

# make -C /etc/mail
# systemctl restart sendmail.service

Now my server is happily using port 587 for outgoing email.

1 comment:

Anonymous said...

Thanks a ton!