Can't send emails anymore

Operating System & Version
CENTOS 7.9 [server]
cPanel & WHM Version
v92.0.6

aanttmarck

Member
Dec 16, 2020
11
1
3
Goiânia, GO
cPanel Access Level
Root Administrator
I can receive email and send emails but they're not getting where they should. They're not going to spam they're simply not really being sent. It's not specific to Gmail, but at first there was an error message like this:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

[email protected]
all hosts for 'gmail.com' have been failing for a long time (and retry time not reached)
Reporting-MTA: dns; server.--.com.br

Action: failed
Final-Recipient: rfc822; [email protected]
Status: 5.0.0
Return-path: <[email protected]>
Received: from [::1] (port=49024 helo=server.--.com.br)
by server.--.com.br with esmtpa (Exim 4.93)
(envelope-from <--@--.com.br>)
id 1kpWrR-00034b-D6
for --@gmail.com; Wed, 16 Dec 2020 10:28:57 -0300
Resent-From: --@--.com.br
Resent-To: r-@gmail.com
Resent-Date: Wed, 16 Dec 2020 10:28:57 -0300
Resent-Message-ID: <[email protected]--.com.br>
MIME-Version: 1.0
Date: Wed, 16 Dec 2020 10:17:33 -0300
From: --@--.com.br
To: --@gmail.com
Subject: teste
User-Agent: Roundcube Webmail/1.4.8
Message-ID: <[email protected]>
X-Sender: --@--.com.br
X-Priority: 1 (Highest)
Content-Type: multipart/mixed;
boundary="=_6b0cefc5ca7d7969a2bc0cfc44391656"
X-Exim-DSN-Information: Due to administrative limits only headers are returned


Where I tried to fix using this

cd /var/spool/exim/db
rm -f retry retry.lockfile
rm -f wait-remote_smtp wait-remote_smtp.lockfile
service exim restart

Still not any fixing, however the error message disappeared. So I noticed another issue with PTR. I've read many threads on this forum about configuring it and even tried to fix it but still nothing.


The system uses an alternate HELO of “<MYHOSTNAME>” when sending mail from the “MYEMAIL” domain.
There is no reverse DNS configured for the IP address (xx.xxx.xxx.xxx) that the system uses to send this domain’s outgoing email.
To fix this problem, contact your system administrator and request that they create the following PTR record at “ns1.reliablesite.net” e “ns2.reliablesite.net”:
Suggested “PTR” (PTR) Record

Name: xxx.xxx.xxx.xx.in-addr.arpa.
Value: <MYHOSTNAME>

I've already tried including a new dns zone with the suggested values, and still trying but nothing changes.
Some threads recommended to check error logs in different folder, and when I get on the folder there is 0 error log files. I'm trying this for like 2 days now and I don't understand what should I do next.
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,275
2,432
363
cPanel Access Level
Root Administrator
Hey there! I believe this is the most important part of your error output, and is the core problem of the issue:

[email protected]
all hosts for 'gmail.com' have been failing for a long time (and retry time not reached)
Reporting-MTA: dns; server.--.com.br
This indicates that your server is not able to look up the IP address of gmail.com. Since this is the case, you won't be able to send an email.

You can verify this by simply trying to ping Gmail with the following command:

Code:
ping gmail.com
If that doesn't give you a proper reply, that indicates an issue with your server's local network. If that is the case, you can manually adjust the /etc/resolv.conf file on the system to use a different set of resolvers, but it would be best to speak with your hosting provider or datacenter to have them check why the current resolvers aren't working properly.

After the resolver issues are fixed, you can clear the Exim retry database with the following commands:

Code:
/usr/sbin/exim_tidydb -t 0d /var/spool/exim retry > /dev/null
/usr/sbin/exim_tidydb -t 0d /var/spool/exim reject > /dev/null
/usr/sbin/exim_tidydb -t 0d /var/spool/exim wait-remote_smtp > /dev/null
as that will let the messages start working immediately.

Can you try that and let me know your results?
 

aanttmarck

Member
Dec 16, 2020
11
1
3
Goiânia, GO
cPanel Access Level
Root Administrator
I think this ping part is OK. In fact my problem is not with gmail, it is with any email really. Like I can't send emails to Outlook either.
Anyways, that's the result I got:

PING gmail.com (172.217.1.101) 56(84) bytes of data.
64 bytes from yyz08s09-in-f101.1e100.net (172.217.1.101): icmp_seq=1 ttl=121 time=0.856 ms
64 bytes from yyz08s09-in-f101.1e100.net (172.217.1.101): icmp_seq=2 ttl=121 time=0.865 ms
64 bytes from yyz08s09-in-f101.1e100.net (172.217.1.101): icmp_seq=3 ttl=121 time=0.835 ms
[...]

I think it's something with reverse DNS cause when I look for it, it seems to have an error.
 

Attachments

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,275
2,432
363
cPanel Access Level
Root Administrator
It's good news that the basic ping check is working well. The next thing to try would be a telnet test, to see if you can reach port 25 of the mail server. You can run this command to check that:

Code:
telnet mx1.cpanel.net 25
and that will perform the test. If you don't have telnet installed, a simple "yum install telnet" will take care of that, as that is provided by the operating system.

Can you try that and let me know?
 

aanttmarck

Member
Dec 16, 2020
11
1
3
Goiânia, GO
cPanel Access Level
Root Administrator
Hi. Sorry for the delay. Well a weird thing happened. I was not getting any error message at all when trying to send emails, they would just not be delivered. But on the weekend, all the error messages came back at once to the mailbox with the same text " all hosts for 'gmail.com' have been ..." .

Anyways, here is the result I got when trying to install and run telnet.

yum install telnet
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 14 kB 00:00:00
* EA4: 74.50.120.xxx
* cpanel-addons-production-feed: 74.50.120.xxx
* cpanel-plugins: 74.50.120.xxx
* base: repos.mia.quadranet.com
* epel: mirror.umd.edu
* extras: reflector.westga.edu
* updates: mirror.umd.edu
EA4 | 2.9 kB 00:00:00
cpanel-addons-production-feed | 2.9 kB 00:00:00
MariaDB103 | 2.9 kB 00:00:00
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
imunify360 | 2.7 kB 00:00:00
packages-microsoft-com-prod | 3.0 kB 00:00:00
updates | 2.9 kB 00:00:00
wp-toolkit-cpanel | 2.9 kB 00:00:00
wp-toolkit-thirdparties | 2.9 kB 00:00:00
zabbix | 2.9 kB 00:00:00
zabbix-non-supported | 951 B 00:00:00
zabbix/x86_64/primary_db | 18 kB 00:00:00
Package 1:telnet-0.17-66.el7.x86_64 already installed and latest version
Nothing to do

telnet mx1.cpanel.net 25
Trying 208.74.121.xx...
Connected to mx1.cpanel.net.
Escape character is '^]'.

220-mx1.cpanel.net ESMTP Exim 4.94 #2 Mon, 21 Dec 2020 08:43:24 -0600
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
500 unrecognized command

500 unrecognized command

500 unrecognized command

500 Too many unrecognized commands
Connection closed by foreign host.
 
Last edited:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,275
2,432
363
cPanel Access Level
Root Administrator
Thanks for the update - that at least lets us know that you can connect to other systems over port 25.

Could you try the same test with a Gmail mailserver and see if that gives a different result?

Code:
telnet gmail-smtp-in.l.google.com 25
 

aanttmarck

Member
Dec 16, 2020
11
1
3
Goiânia, GO
cPanel Access Level
Root Administrator
Alright. Apparently nothing wrong here

telnet gmail-smtp-in.l.google.com 25
Trying 74.125.141.xx...
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP r14si2183917vsn.230 - gsmtp
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,275
2,432
363
cPanel Access Level
Root Administrator
The PTR would be a separate issue from mails not leaving the server in general. It's also unlikely that the reverse DNS will be handled by your server, so I'd recommend speaking with your hosting provider about that.

If you check the full entry in /var/log/exim_mainlog when you try and send a message, do you see anything else in the logs there that would give us more detail on what is happening?
 

aanttmarck

Member
Dec 16, 2020
11
1
3
Goiânia, GO
cPanel Access Level
Root Administrator
I run 'more /var/log/exim_mainlog' and it returns a huge list of lines just like this one. All the lines are the same just changing the date-time and email of course.

'2020-12-20 03:12:05 1kplRw-00045q-5m == [email protected] R=send_via_sendgrid T=sendgrid_smtp defer (-53): retry time not
reached for any host for 'gmail.com''

Then I run 'exigrep 'gmail' /var/log/exim_mainlog' and it returns this

2020-12-20 03:12:17 1kpXPh-0007L2-8Y == [email protected] R=send_via_sendgrid T=sendgrid_smtp defer (-53): retry time not reached for any host for 'gmail.com'
2020-12-20 03:12:35 1kpXPh-0007L2-8Y == [email protected] R=send_via_sendgrid T=sendgrid_smtp defer (-53): retry time not reached for any host for 'gmail.com'
2020-12-20 04:12:30 1kpXPh-0007L2-8Y == [email protected] R=send_via_sendgrid T=sendgrid_smtp defer (-53): retry time not reached for any host for 'gmail.com'
2020-12-20 05:12:39 1kpXPh-0007L2-8Y == [email protected] R=send_via_sendgrid T=sendgrid_smtp defer (-53): retry time not reached for any host for 'gmail.com'
2020-12-20 06:12:13 1kpXPh-0007L2-8Y == [email protected] R=send_via_sendgrid T=sendgrid_smtp defer (-53): retry time not reached for any host for 'gmail.com'
2020-12-20 07:12:48 1kpXPh-0007L2-8Y == [email protected] R=send_via_sendgrid T=sendgrid_smtp defer (-53): retry time not reached for any host for 'gmail.com'
2020-12-20 08:12:41 1kpXPh-0007L2-8Y == [email protected] R=send_via_sendgrid T=sendgrid_smtp defer (-53): retry time not reached for any host for 'gmail.com'
2020-12-20 09:12:32 1kpXPh-0007L2-8Y == [email protected] R=send_via_sendgrid T=sendgrid_smtp defer (-53): retry time not reached for any host for 'gmail.com'
2020-12-20 10:12:30 1kpXPh-0007L2-8Y == [email protected] R=send_via_sendgrid T=sendgrid_smtp defer (-53): retry time not reached for any host for 'gmail.com'
2020-12-20 11:12:07 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [xxx.xx.123.97] 535 Authenticationfailed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:07 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [xxx.xx.123.82] 535 Authenticationfailed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:08 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [xxx.xx.123.53] 535 Authenticationfailed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:08 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [xxx.xx.115.117] 535 Authentication failed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:09 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [xxx.xx.123.95] 535 Authenticationfailed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:09 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [xxx.xx.115.116] 535 Authentication failed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:09 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [54.209.9.105] 535 Authentication failed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:09 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [35.171.120.36] 535 Authenticationfailed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:10 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [3.212.77.9] 535 Authentication failed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:10 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [54.160.61.157] 535 Authenticationfailed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:10 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [xxx.xx.115.79] 535 Authenticationfailed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:11 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [xxx.xx.115.53] 535 Authenticationfailed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:11 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [3.234.124.254] 535 Authenticationfailed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:11 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [xxx.xx.123.58] 535 Authenticationfailed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:12 1kpXPh-0007L2-8Y sendgrid_login authenticator failed H=smtp.sendgrid.net [xxx.xx.115.18] 535 Authenticationfailed: The provided authorization grant is invalid, expired, or revoked
2020-12-20 11:12:12 1kpXPh-0007L2-8Y == [email protected] R=send_via_sendgrid T=sendgrid_smtp defer (-42): authentication required but authentication attempt(s) failed
2020-12-20 11:12:12 1kpXPh-0007L2-8Y ** [email protected]: retry timeout exceeded
2020-12-20 11:12:12 1kpXPh-0007L2-8Y Completed

I have SendGrid key connected to the website through the use of this plugin called WP Mail SMTP. When I try to send test emails through the plugin on the Wordpress platform it is sent without no error to my box.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,275
2,432
363
cPanel Access Level
Root Administrator
I would try clearing the Exim retry database with these commands, and then sending another message:

Code:
/usr/sbin/exim_tidydb -t 0d /var/spool/exim retry > /dev/null
/usr/sbin/exim_tidydb -t 0d /var/spool/exim reject > /dev/null
/usr/sbin/exim_tidydb -t 0d /var/spool/exim wait-remote_smtp > /dev/null
Can you try that and let me know if that gets things working? Your connection tests look good, but for some reason Exim is still hung up on the retry portion.
 

aanttmarck

Member
Dec 16, 2020
11
1
3
Goiânia, GO
cPanel Access Level
Root Administrator
Cleared everything with these commands. Now I'm back to the same stage: no emails being really sent and no error message to my mailbox. But I suppose they will appear eventually later. I don't know how I can send emails through a plugin easily but not from RoundCube.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,275
2,432
363
cPanel Access Level
Root Administrator
That also doesn't make sense to me either, as I'd expect everything to work, or everything to fail.

You can always contact our team to have us check the system directly through a support ticket and we'd likely be able to get you better details.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,275
2,432
363
cPanel Access Level
Root Administrator
Thanks for getting me that number. It looks like our team was able to track down some authentication issues between your server and Sendgrid, so it looks like we are on the right track. Feel free to reply here or to the ticket if you need more information!
 

aanttmarck

Member
Dec 16, 2020
11
1
3
Goiânia, GO
cPanel Access Level
Root Administrator
Alright. Already set up SendGrid again, but honestly there was no difference at all. The configurations were pretty much correct, except for the api key which I've mistakenly confused with the api key id. But even putting the actual correct api key of sendgrid the emails are not ok. I opened another ticket at SendGrid. Thanks for the help. I'll contact if this actually is solved.