Bootstrap FreeKB - Postfix (Email) - Relay emails through mail.twc.com (Spectrum Time Warner Cable)
Postfix (Email) - Relay emails through mail.twc.com (Spectrum Time Warner Cable)

Updated:   |  Postfix (Email) articles

Some email recipients (such as hotmail and outlook) will refuse emails that are sent from a server that has a dynamic IP address. In this example, when attempting to send an email to jane.doe@hotmail.com, the Postfix email logs identify that Hotmail refused the email because the email was sent from a server with a dynamic IP address.

[root@server1 ~]# tail /var/log/maillog
Aug 16 10:05:49 example postfix/smtp[6660]: 894C4BA14E8: to=, relay=mx1.hotmail.com[65.68.12.214]:25, delay=119, delays=117/0.03/2.2/0.25, dsn=5.0.0, status=bounced (host mx1.hotmail.com[65.68.12.214] said: 550 DY-001 (SNT004-MC1F35) Unfortunately, messages from 76.45.12.78 were not sent. Please contact your Internet service provider. You can tell them that Hotmail does not relay dynamically-assigned IP ranges. You can also refer your provider to http://mail.live.com/mail/troubleshooting.aspx#errors. (in reply to MAIL FROM command))

 

 

Relaying emails through a third party resolves this issue.


 

Emails can be relayed through:

  • Your Internet Service Provider (ISP) (e.g. Spectrum, AT&T)
  • Your domain name registrar (e.g. GoDaddy, 1and1)
  • An email provider (e.g. SendGrid)

 

Add the following line to /etc/postfix/main.cf.

relayhost = [mail.twc.com]:587

 

It is probably a good idea to also include the following in /etc/postfix/main.cf.

smtpd_sasl_auth_enable = yes
smtpd_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = noanonymous
smtpd_tls_security_level = encrypt
header_size_limit = 4096000

 

Create the sasl_passwd file:

~]# touch /etc/postfix/sasl_passwd

 

Add the following line to the sasl_passwd file:

  • Replace username with your Spectrum or Time Warner Cable email address (I think this needs to be your @new.rr.com email address)
  • Replace password with your @new.rr.com email address password (I had to reach out to Spectrum or Time Warner Cable support to get or reset this password)
[mail.twc.com]:587 john.doe@new.rr.com:itsasecret

 

The postmap command will create or update the sasl_passwd.db file from the lines in the sasl_passwd file.

~]# postmap /etc/postfix/sasl_passwd

 

Ensure that only root and read and write these files.

~]# chown root:root /etc/postfix/sasl_passwd
~]# chown root:root /etc/postfix/sasl_passwd.db
~]# chmod 600 /etc/postfix/sasl_passwd
~]# chmod 600 /etc/postfix/sasl_passwd.db

 

The strings command can be used to confirm that the sasl_passwd.db files looks good.

~]# strings /etc/postfix/sasl_passwd.db
john.doe@new.rr.com:itsasecret
[smtp.example.com]:587

 

The ps command can be used to determine if your system is using init or systemd. If PID 1 is init, then you will use the service command. If PID 1 is systemd, then you will use the systemctl command.

If your system is using systemd, use the systemctl command to restart postfix.

systemctl restart postfix
systemctl status postfix

 

If your system is using init, use the service command to restart postfix.

service postfix restart
service postfix status

 

On the Postfix server, use the mailx command to send an email to someone.

echo "test" | mailx -s test -A default john.doe@example.com

 

Ensure /var/log/maillog should show have relay=mail.twc.com.

May 12 19:59:10 mail.example.com postfix/smtp[27836]: E56D660173: to=<jane.doe@example.com>, relay=mail.twc.com[107.14.73.68]:587, delay=21, delays=20/0.13/0.24/0.24, dsn=2.0.0, status=sent (250 2.0.0 OK FC/59-29375-E5A56195)

 

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter a8141c in the box below so that we can be sure you are a human.