Server not using FQDN to send mail, being rejected
Server is using its hostshort name, not its FQDN to send email FROM and HELO. It's being rejected:
How do I force it to use its full hostname? It's using it in the From header as well as HELO, despite /etc/mailhelo forced to be hostname -f, which works, and full forward and reverse is set ok.
host mx.*.com.cust.example.com [216.40.xx.x]
SMTP error from remote mail server after HELO u202:
504 5.5.2 : Helo command rejected: need fully-qualified hostname
How do I force it to use its full hostname? It's using it in the From header as well as HELO, despite /etc/mailhelo forced to be hostname -f, which works, and full forward and reverse is set ok.
-
I suspect your hostname has reverted. You on a cloud provider? Google maybe? We see this a LOT with google. Run the command hostname from ssh and see what it returns. If it just returns the first part of the hostname, that is your problem. You can run this command: whmapi1 sethostname hostname=host.domain.com 0 -
Hostname does indeed return just the hostshort, of course hostname -f works properly. On most unix hosts hostname just returns hostshort too though, so I didnt think much of it. This isnt google cloud, but it is Proxmox 5.2 in an lxc container. That command took a good 15 seconds to run, splatted out a buncha raw html about what it was doing, but now hostname returns the same as hostname -f. And now mail from the cmdline from root as a test does indeed say as it should. Will test with clients. thanks! 0 -
Yeah, with our google clients we actually ended up setting up a cron to check the host name and run that command if it reverts. Tends to happen on reboots. 0 -
Hello, I've marked this thread as solved. Thanks! 0 -
I just ran into this again, figured it was our old Cpanel that was the problem. Nope, new Centos, new Cpanel, same problem. Note, this is lxc under proxmox 5.x, which does mess with startup settings/scripts. So I've added /usr/bin/whmapi1 sethostname hostname=host.domain.com
to /etc/rc.local, see if that forces it after a reboot. (and chmod +x /etc/rc.d/rc.local of course, since i should go to the trouble of making a proper systemd unit description but that's a pain, and systemd sucks)0
Please sign in to leave a comment.
Comments
6 comments