Skip to main content

Server not using FQDN to send mail, being rejected

Comments

6 comments

  • GOT
    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
  • mathx
    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
  • GOT
    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
  • cPanelMichael
    Hello, I've marked this thread as solved. Thanks!
    0
  • mathx
    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
  • cPanelMichael
    Hello @mathx, Feel free to open a
    0

Please sign in to leave a comment.