Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED Server not using FQDN to send mail, being rejected

Discussion in 'E-mail Discussion' started by mathx, Jan 31, 2019.

  1. mathx

    mathx Member

    Joined:
    Jan 16, 2017
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    DataCenter Provider
    Server is using its hostshort name, not its FQDN to send email FROM and HELO. It's being rejected:

    Code:
      host mx.*.com.cust.example.com [216.40.xx.x]
        SMTP error from remote mail server after HELO u202:
        504 5.5.2 <u202>: 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.
     
    #1 mathx, Jan 31, 2019
    Last edited by a moderator: Jan 31, 2019
  2. GOT

    GOT Get Proactive! PartnerNOC

    Joined:
    Apr 8, 2003
    Messages:
    1,478
    Likes Received:
    185
    Trophy Points:
    193
    Location:
    Chesapeake, VA
    cPanel Access Level:
    DataCenter Provider
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. mathx

    mathx Member

    Joined:
    Jan 16, 2017
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    DataCenter Provider
    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 <root@fullhostname.domain.com> as it should.

    Will test with clients. thanks!
     
  4. GOT

    GOT Get Proactive! PartnerNOC

    Joined:
    Apr 8, 2003
    Messages:
    1,478
    Likes Received:
    185
    Trophy Points:
    193
    Location:
    Chesapeake, VA
    cPanel Access Level:
    DataCenter Provider
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,335
    Likes Received:
    2,162
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I've marked this thread as solved.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. mathx

    mathx Member

    Joined:
    Jan 16, 2017
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    DataCenter Provider
    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

    Code:
    /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)
     
    #6 mathx, May 23, 2019
    Last edited: May 23, 2019
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,335
    Likes Received:
    2,162
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @mathx,

    Feel free to open a support ticket if you'd like us to take a closer look. You can post the ticket number here and we'll link this thread to it.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice