• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue SPF error sending IP 127.0.0.1

pleskadm

New Pleskian
Server operating system version
CentOS Linux release 7.6.1810
Plesk version and microupdate number
Plesk Obsidian Web Host Edition Versión 18.0.55 Actualización #1
Hello

I have a Plesk server with several IPs, and I use one of them, with a good reputation, to send emails.
In mail settings "Send from the specified IP addresses"

But Plesk indicates that the emails are sent from the local IP:
Received: from mail.domain.com (localhost.localdomain [127.0.0.1])
(I'm not using WebMail)

This causes the SPF error since I specify the public IP
v=spf1 +a +mx ip4:xx.xx.xx.xx -all

Tools like mxtoolbox.com/deliverability indicate:
SPF Authentication - SPF Failed for IP - 127.0.0.1

The only way to get the SPF correct is to add the local IP
v=spf1 +a +mx ip4:xx.xx.xx.xx ip4:127.0.0.1 -all

But this doesn't seem like the right thing to do.

How can you prevent Plen from putting the 127.0.0.1 IP instead of the public one?
This does not happen with emal settings: "Send from domain ip"
 
Please edit /etc/postfix/main.cf and either uncomment and edit or edit the "myhostname" entry to contain your host's name. This will cause Postfix not to use "localhost" or "127.0.0.1" as the sender host name, but the real host name. Add that real host name to your SPF record.
Restart or reload Postfix after the change (systemctl postfix reload).
 
After doing this in main.cfg, postfix continues sending the address 127.0.0.1 and the SPF is evaluated against this IP, instead of the public IP

In main.cfg
myhostname = mail.infoser.eu

header sent in the email
Received: from mail.infoser.eu ([37.153.90.190])
by mail.infoser.eu (host1105.infoser.net [127.0.0.1]) (amavisd-new, port 10024)
 
Ah o.k., can you check /etc/hosts what the entries are there? Do you have your public IP listed in it?
 
Yes, the public IP is listed in /etc/hosts

The problem is that three IP hops appear, and the first of them is localhost.
This causes the SPF record to be taken as erroneous, unless the ip4:127.0.0.1 mechanism is added.
With this change the SPF is correct, but emails are still rejected from some providers

Attached iamgen of the mxtoolbox report
 

Attachments

  • Mail_SPF.jpg
    Mail_SPF.jpg
    138.2 KB · Views: 19
It all sounds quite odd to me. It's not a known issue and with normal mail settings you don't have the localhost issue either. You also should not have it using the myhostname setting in main.cf. Maybe it is related to the "Send from the specified IP addresses" setting. Have you considered changing that to "Send from domain IP addresses"?
Please contact support with your question if this does not help: https://support.plesk.com
 
Hi, did you solve this problem? I have the same issue. The outgoing mail mode is set to "Send from domain IP addresses" (was set default). I tried with switching to "Send from the specified IP addresses", choosing the Server IP, but the problem persists. Checking the SPF with MX Toolbox I get the error "SPF Failed for IP - 127.0.0.1"...
 
I'm facing same problem - didn't know since when but I think it started in the last 4 weeks...

BR
 

Attachments

  • spf_127.0.0.1_error.png
    spf_127.0.0.1_error.png
    69.6 KB · Views: 16
I recommend to let Plesk support team check it on your server.

To sign-in to support please go to https://support.plesk.com

If you experience login issues, please see this KB article:
https://support.plesk.com/hc/en-us/...rt-plesk-com-and-password-reset-does-not-work

If you bought your license from a reseller, your reseller should provide support for you. If the reseller does not provide support, here is an alternative:
https://support.plesk.com/hc/en-us/articles/12388090147095-How-to-get-support-directly-from-Plesk-
 
Back
Top