SPF SOFTFAIL domain of transitioning [email protected] does not designate X.X.X.X as permitted sender)

sz3jdii

Verified User
Joined
Nov 7, 2020
Messages
8
in my company I have the following error.

softfail (google.com: domain of transitioning [email protected] does not designate X.X.X.X as permitted sender) client-ip=X.X.X.X;

Let's say my mail.company.com server is Y.Y.Y.Y, every user connects to his/her mail account from Thunderbird, the SMTP/POP3/IMAP is served by DirectAdmin hosted on Y.Y.Y.Y domain. Some of users who uses GMail to download mails from external POP3 server (mail.company.com) are receiving the above error and email is in SPAM directory. The SPF record which I had was:

v=spf1 a mx ip4:Y.Y.Y.Y ~all
The problem is the designated IP X.X.X.X is client's ip not not SMTP server's ip Y.Y.Y.Y.

Thank you for any help.
 
I solved this by setting custom received header in exim config (/etc/exim.conf).
In above file I've added:


Code:
received_header_text = ${if def:authenticated_id {Received: from $primary_hostname ([X.X.X.X] helo=[s1.example.com]) by $primary_hostname with ESMTP\n\t(Exim $version_number)\n\t${if def:sender_address {(envelope-from <$sender_address>)\n\t}}id $message_exim_id${if def:received_for {\n\tfor $received_for}}\n\t}}Received: ${if def:sender_rcvhost {from $sender_rcvhost\n\t}{${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}by $primary_hostname ${if def:received_protocol {with $received_protocol}} ${if def:tls_cipher {($tls_cipher)\n\t}}(Exim $version_number)\n\t${if def:sender_address {(envelope-from <$sender_address>)\n\t}}id $message_exim_id${if def:received_for {\n\tfor $received_for}}

where X.X.X.X is mail server IP and s1.example.com is mail server hostname or ip address.
I've put that after:


Code:
#EDIT#1:
# primary_hostname =
smtp_active_hostname = ${if exists{/etc/virtual/helo_data}{${lookup{$interface_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}}

After that I've restarted exim:

Code:
service exim restart

And now Google is not failing spam checks due to SPF SOFTFAIL.
 
Back
Top