Cannot send mail to a particular domain

Posted: June 10, 2016 in Linux

If you face an issue in sending mail to the email addresses under a particular domain with the following SPF error,

===============

2016-06-10 12:37:17 1bBKkV-0001P9-Hr SMTP connection outbound 1465558637 1bBKkV-0001P9-Hr username@domain.com
2016-06-10 12:37:20 1bBKkV-0001P9-Hr ** username2@domain2.com R=dkim_lookuphost T=dkim_remote_smtp H=cheviot2domain.com [XX.XX.XX.XX] X=TLSv1:AES256-SHA:256 CV=yes: SMTP error from remote mail server after RCPT TO:<username2@domain2.com>: 550-5.7.1 sender <enquiries@domain.com> via hostname (hostname [XX.XX.XX.XX]) SPF result Fail; #702 (s59CbH067804399200)\n550-5.7.1 The line above says why Newcastle University rejected mail.\n550-5.7.1 Please see <http://www.ncl.ac.uk/itservice/security/emailreject/&gt;\n550 5.7.1 for a more detailed explanation.

===============

Fix

===
change spf to “v=spf1 mx a” and save it in domain’s dns zone file. (You can create SPF record for the sender domain in http://www.spfwizard.net/ – First 2 options should be “yes”)

Now test by sending a mail from your domain’s test account.The result should be

=======

]# grep 1bBNRy-0002Sj-6P /var/log/exim_mainlog
2016-06-10 15:30:18 1bBNRy-0002Sj-6P H=(hostname) [::1]:37898 Warning: Message has been scanned: no virus or other harmful content was found
2016-06-10 15:30:18 1bBNRy-0002Sj-6P H=(hostname) [::1]:37898 Warning: “SpamAssassin as cpaneleximscanner detected OUTGOING smtp message as NOT spam (-1.0/99)”
2016-06-10 15:30:18 1bBNRy-0002Sj-6P <= test123@domain.com H=(hostname) [::1]:37898 P=esmtpa A=dovecot_login:test123@domain.com S=825 id=1ed445e8e7cff46243c403cbb58d0bb3.squirrel@hostname T=”Test mail” for username2@domain2.com
2016-06-10 15:30:18 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1bBNRy-0002Sj-6P
2016-06-10 15:30:18 1bBNRy-0002Sj-6P SMTP connection outbound 1465569018 1bBNRy-0002Sj-6P username@domain.com
2016-06-10 15:30:23 1bBNRy-0002Sj-6P => username2@domain2.com R=dkim_lookuphost T=dkim_remote_smtp H=cheviot2domain.com [XX.XX.XX.XX] X=TLSv1:AES256-SHA:256 CV=yes C=”250 2.0.0 message s59FUK0435215064B9 accepted #554 (s59FUI043521506400)”
2016-06-10 15:30:23 1bBNRy-0002Sj-6P Completed

========

Leave a comment