The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Sendmail and Exim not working

Discussion in 'E-mail Discussions' started by richardwatton, Feb 1, 2017.

Tags:
  1. richardwatton

    richardwatton Member

    Joined:
    Feb 1, 2017
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Wales
    cPanel Access Level:
    Root Administrator
    Hi,

    I have recently set up WHM on a cloud server, and I am having problems sending mail. I do not receive notifications from cPanel, and sendmail does not work at all. I have a web site running but without mail functions including php mail, but the DNS servers are OK and I can traceroute domains. If I run the mail troubleshooter on an email address, it reports the correct lookup host.
    In WHM the mail queue has every email in it that has been sent so far. The mail delivery reports are either 'retry timeout exceeded', 'connection timed out', or 'retry time not reached for any host after a long failure period'.

    If I try to use sendmail from the command line, I get this in exim_mainlog:


    Code:
    2017-02-01 16:10:18 1cYxUA-0009rM-Fh ** richard@domain.co.uk <root@whm.server.tld> R=dkim_lookuphost T=dkim_remote_smtp: retry time not reached for any host after a long failure period
    2017-02-01 16:10:18 1cYxUA-0009rM-Fh Frozen (delivery error message)
    I have changed the Exim listening port from 25, although I don't see how this would cause a problem sending mail. Apart from that, everything is still in the default configuration when WHM was set up.
    Any help would be greatly appreciated.​
     
    #1 richardwatton, Feb 1, 2017
    Last edited by a moderator: Feb 1, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Outgoing traffic over Port 25 is required in order for Exim to connect to the remote mail server. Could you verify you can successfully telnet to one of the remote mail servers listed in the logs over port 25 from the cPanel server? EX:

    Code:
    telnet remote-mail-server 25
    I recommend reaching out to your data center or hosting provider to verify if there's anything filtering port 25 traffic in their network or firewall rules if the telnet connection fails. Providers will often block port 25 as a SPAM prevention technique.

    Thank you.
     
  3. richardwatton

    richardwatton Member

    Joined:
    Feb 1, 2017
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Wales
    cPanel Access Level:
    Root Administrator
    Thanks, I tried telnet on port 25 which I know is blocked, didn't work but I could telnet on port 587. I've already added that port to 'Exim Mail Server (on another port)' in WHM and opened the port in the server firewall. This is what I got from telnet:
    Connected to mx1.server.com.
    Escape character is '^]'.
    220 antispam3.server.com ESMTP Exim 4.86-111764 Wed, 01 Feb 2017 17:10:54 +0000

    So I assume the port is not an issue? Or does it have to be 25 to send mail out?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Outgoing traffic over Port 25 is required in order for your system to connect to remote mail servers. The following post explains the reason for this:

    change port 25

    Thank you.
     
  5. richardwatton

    richardwatton Member

    Joined:
    Feb 1, 2017
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Wales
    cPanel Access Level:
    Root Administrator
    Thanks for the link which explains the problem very well. I have had my hosting company remove the block on port 25 and now email is sending from the server. However, when I use mail from the console to send an email, I get this error '550-Sender has no A, AAAA, or MX DNS records. whm.hostname.co.uk'. Here is the output from mail:

    Code:
    LOG: MAIN
      cwd=/ 5 args: send-mail -i -v -- [EMAIL]me@domain.com[/EMAIL]
    LOG: MAIN
      <= [EMAIL]root@whm.hostname.co.uk[/EMAIL] U=root P=local S=508 T="test"
    [root@whm /]# LOG: MAIN
      cwd=/var/spool/exim 4 args: /usr/sbin/exim -v -Mc 1cZFHx-0001Zb-Sk
    delivering 1cZFHx-0001Zb-Sk
    Connecting to mx1.spamfiltering.com [72.249.150.158]:25 ... connected
      SMTP<< 220 antispam3.spamfiltering.com ESMTP Exim 4.86-111764 Thu, 02 Feb 2017 11:10:55 +0000
      SMTP>> EHLO whm.hostname.co.uk
      SMTP<< 250-antispam3.spamfiltering.com Hello whm.hostname.co.uk [77.68.8.55]
             250-SIZE
             250-8BITMIME
             250-STARTTLS
             250-PRDR
             250 HELP
      SMTP>> STARTTLS
      SMTP<< 220 TLS go ahead
    LOG: MAIN
      [72.249.150.158] SSL verify error: certificate name mismatch: "/OU=Domain Control Validated/OU=Hosted by UNITED COMMUNICATIONS LIMITED/OU=COMODO SSL/CN=antispam1.spamfiltering.com"
      SMTP>> EHLO whm.hostname.co.uk
      SMTP<< 250-antispam3.spamfiltering.com Hello whm.hostname.co.uk [77.68.8.55]
             250-SIZE
             250-8BITMIME
             250-PRDR
             250 HELP
      SMTP>> MAIL FROM:<root@whm.hostname.co.uk> SIZE=1546
      SMTP<< 250 OK
      SMTP>> RCPT TO:<me@domain.com>
      SMTP<< 550-Sender has no A, AAAA, or MX DNS records. whm.hostname.co.uk
             550 whm.hostname.co.uk
      SMTP>> QUIT
    All the outgoing emails are frozen in the mail queue with the error '550-Sender has no A, AAAA, or MX DNS records. whm.hostname.co.uk'. But in the DNS zone for whm.hostname.co.uk, there is an A entry (points to the server IP) and an MX entry (just points to the FQDN of whm.hostname.co.uk)

    The problem seems to be with the FQDN of the hostname, which in my case is something like whm.hostname.co.uk. If I run nslookup I get the following output:
    Code:
    [root@whm /]# nslookup whm.hostname.co.uk
    Server:         x.x.x.x
    Address:        x.x.x.x#53
    
    ** server can't find whm.hostname.co.uk: NXDOMAIN
    
    But when I run it without the whm part, I get this:
    Code:
    [root@whm /]# nslookup hostname.co.uk
    Server:         x.x.x.x
    Address:        x.x.x.x#53
    
    Non-authoritative answer:
    Name:   hostname.co.uk
    Address: x.x.x.x
    
    Any help greatly appreciated.
     
    #5 richardwatton, Feb 2, 2017
    Last edited by a moderator: Feb 2, 2017
  6. richardwatton

    richardwatton Member

    Joined:
    Feb 1, 2017
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Wales
    cPanel Access Level:
    Root Administrator
    Do I need to configure reverse DNS for BIND in WHM, as per this link?
     
  7. richardwatton

    richardwatton Member

    Joined:
    Feb 1, 2017
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Wales
    cPanel Access Level:
    Root Administrator
    Ah, missed an A entry on the hostname! With the port unblocked, email is now working. Thanks.
     
    cPanelMichael likes this.
  8. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,619
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Thanks for updating the thread.
     
Loading...

Share This Page