I have a database server connected to an application server. The database server contains SQL code that generates automated emails to customers. The database server code creates the email then logs into the application server using the login credentials of one of the users to send the email.
One of my customers is not receiving such emails. Actually, their server receives the email, but rejects it as spam.
I think the reason for this is the Received-SPF
external ip address xxx.xxx.xxx.xxx
for the application server is different than the Received:
ip address, which is the local IP for the database server. The auto-reply sent back from my customer ([email protected] below) server states
Diagnostic-Code: smtp; 5.3.0 - Other mail system problem 550-'5.7.1 Client does not have permissions to send as this sender' (delivery attempts: 0)
and includes the following header information:
Received-SPF: Pass (mail.customercompany.com: domain of
[email protected] designates xxx.xxx.xxx.xxx as permitted
sender) identity=mailfrom; client-ip=xxx.xxx.xxx.xxx;
receiver=mail.customercompany.com;
envelope-from="[email protected]";
x-sender="[email protected]"; x-conformance=spf_only;
x-record-type="v=spf1"
...
Received: from host3.mycompany.com ([xxx.xxx.xxx.xxx])
by mail.customercompany.com with ESMTP...SHA384; 02 May 2017 15:40:41 -0400
Received: from [192.168.0.1] (port=17111 helo=mail.mycompany.com)
by host3.mycompany.com with esmtpa (Exim 4.89)
(envelope-from <[email protected]>)
id 1d5df6-00023Y-SB
for [email protected]; Tue, 02 May 2017 12:40:40 -0700
...
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - host3.mycompany.com
X-AntiAbuse: Original Domain - customercompany.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - mycompany.com
X-Get-Message-Sender-Via: host3.mycompany.com: authenticated_id: [email protected]
X-Authenticated-Sender: host3.mycompany.com: [email protected]
Is it acceptable to include a private (internal) IP address in a SPF record, along with external IP address? Any downside?
Does this look like it might resolve this issue?
Any way to get the email header to report the application server IP address xxx.xxx.xxx.xxx
instead of the db server internal ip [192.168.0.1]
appearing in the Received:
line (without porting the code to the application server)?
I don't want the outside world to see the external IP of the database server.