How to reduce number of failed mail retries and avoid triggering the 'exceeded the max defers and failures per hour'?

plumdesign

Member
Feb 15, 2023
16
2
3
Belgrade
cPanel Access Level
Root Administrator
Due to (for me) unknown reason mail server retries 10-20 times to resend the mail message and triggers the outgoing traffic block temporarely for each destination mail address that rejects the e-mail message.

example:
12 errors in Mar 14, 2023, 3:49:03 AM
552 5.2.2 <*****@******.com> Quota exceeded (mailbox for user is full) (in reply to RCPT TO command)

after that
4 errors in Mar 14, 2023, 3:49:03 AM
retry time not reached

and finally

Domain *****.com has exceeded the max defers and failures per hour (5/5 (100%)) allowed. Message discarded.


How can I reduce number of retries or do anything to stop this.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
Hey there! I don't believe the message you are examining is the root cause of the issue. Since the failed delivery is happening the same second as the quota exceeded message, that indicates the retry limit has already been exceeded.

To get the full picture of why this is happening, you would want to use this command on the Exim logs:

Code:
grep 1pbKMv-001Ms4-0J /var/log/exim_mainlog
Just replace "1pbKMv-001Ms4-0J" with the specific mail ID from your email transaction, and that will show the full history of that email process. If the retries are really what is causing the message to fail, I would expect there to be several hours between the first instance and the failure.

You can also confirm that your Exim configuration hasn't been set to any odd values for retyring emails too quickly. This command will show you the last few lines of that configuration:

Code:
tail -n 7 /etc/exim.conf
which should give you output similar to the following:

Code:
+secondarymx                    *                               F,4h,5m; G,16h,1h,1.5; F,4d,8h
*                               *                               F,2h,15m; G,16h,1h,1.5; F,4d,8h
If your exim.conf file has similar content there, it is using the defaults.
 
  • Like
Reactions: plumdesign

plumdesign

Member
Feb 15, 2023
16
2
3
Belgrade
cPanel Access Level
Root Administrator
i got this:

+secondarymx * F,4h,5m; G,16h,1h,1.5; F,4d,8h
* * F,2h,15m; G,16h,1h,1.5; F,4d,8h

what does it mean? - that i'm using defaults and this setup is OK?

i have examined suggested /var/log/exim_mainlog and there is a lot of deferrals in the same second? this blocks mail send for several minutes of all other e-mails.
 
Last edited:

plumdesign

Member
Feb 15, 2023
16
2
3
Belgrade
cPanel Access Level
Root Administrator
update:

here is the log for message (real addresses and IP are replaced):

# End of Exim 4 configuration[root@server31 ~]# grep 1pbtWF-00GKY0-3C /var/log/exim_mainlog
2023-03-14 02:32:02 1pbtWF-00GKY0-3C <= [email protected] H=ns3144681.ip-XX-XX-YY.eu (myserver.xyz) [XX.YY.ZZ.QQ]:45238 P=esmtpa A=dovecot_login:[email protected] S=25551 id=[email protected] T="MAIL TITLE" for [email protected]
2023-03-14 02:32:02 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1pbtWF-00GKY0-3C
2023-03-14 02:32:02 1pbtWF-00GKY0-3C Sender identification U=myusename D=mydomain.xyz S=[email protected]
2023-03-14 02:32:02 1pbtWF-00GKY0-3C SMTP connection outbound 1678757522 1pbtWF-00GKY0-3C mydomain.xyz [email protected]
2023-03-14 02:32:02 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [XX.220.42.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [Z7WX4CXSMo-2lZ5pOAalsw.uk71]
2023-03-14 02:32:02 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [YY.ZZ.42.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [9Qv_Cwl1NKWT4enQvxozjw.uk183]
2023-03-14 02:32:02 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [YY.ZZ.42.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [SriGODDFPaatpSxPIWdjIA.uk231]
2023-03-14 02:32:02 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [oVhouIgNNtuwdzYitEDAug.uk94]
2023-03-14 02:32:03 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [Q3PfaOiNNu2EHwPgk39jiQ.uk2]
2023-03-14 02:32:03 1pbtWF-00GKY0-3C == [email protected] R=dkim_lookuphost T=dkim_remote_smtp defer (-44) H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [Q3PfaOiNNu2EHwPgk39jiQ.uk2]
2023-03-14 02:36:00 1pbtWF-00GKY0-3C == [email protected] routing defer (-52): retry time not reached
2023-03-14 02:51:08 1pbtWF-00GKY0-3C Sender identification U=myusename D=mydomain.xyz S=[email protected]
2023-03-14 02:51:08 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [YY.ZZ.42.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [88gYlyc4Mf61UMh8DEqDzw.uk247]
2023-03-14 02:51:09 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [OTrIehhzOIibxWWROQKkuQ.uk272]
2023-03-14 02:51:09 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [XX.220.42.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [tKdxdLUUN1iqecdGhq9m4A.uk7]
2023-03-14 02:51:09 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [0tf24fWfPgG1AenS8IcEmQ.uk318]
2023-03-14 02:51:09 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [YY.ZZ.42.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [aeKzzwHlM-uVwCHlFmu42w.uk309]
2023-03-14 02:51:09 1pbtWF-00GKY0-3C == [email protected] R=dkim_lookuphost T=dkim_remote_smtp defer (-44) H=eu-smtp-inbound-1.mimecast.com [YY.ZZ.42.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [aeKzzwHlM-uVwCHlFmu42w.uk309]
2023-03-14 03:08:12 1pbtWF-00GKY0-3C Sender identification U=myusename D=mydomain.xyz S=[email protected]
2023-03-14 03:08:12 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [MM.NN.217.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [Od0nVEtLNdyegj9Bf4O0ZA.uk304]
2023-03-14 03:08:13 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [YY.ZZ.42.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [0TRnF__vNCm1rZPlsiTmRQ.uk23]
2023-03-14 03:08:13 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [MM.NN.217.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [oLwmT3ObNre-iJ-vJnHe3A.uk160]
2023-03-14 03:08:13 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [YY.ZZ.42.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [G7bcAlplNhiYk9m6YrYw0w.uk319]
2023-03-14 03:08:13 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [MM.NN.217.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [o0HRsV2vNy2ljktZbXjpdg.uk310]
2023-03-14 03:08:13 1pbtWF-00GKY0-3C == [email protected] R=dkim_lookuphost T=dkim_remote_smtp defer (-44) H=eu-smtp-inbound-2.mimecast.com [MM.NN.217.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [o0HRsV2vNy2ljktZbXjpdg.uk310]
2023-03-14 03:21:59 1pbtWF-00GKY0-3C == [email protected] routing defer (-52): retry time not reached
2023-03-14 03:40:21 1pbtWF-00GKY0-3C Sender identification U=myusename D=mydomain.xyz S=[email protected]
2023-03-14 03:40:21 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [YY.ZZ.42.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [ZvgBJoq9MY-Q-qC3XQvBeg.uk167]
2023-03-14 03:40:21 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [YY.ZZ.42.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [5dKcMlBRPby2auiXS-VNRw.uk61]
2023-03-14 03:40:22 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [XX.220.42.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [R3WrdWBUOvyqAGi_0CWIyg.uk249]
2023-03-14 03:40:22 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [2da7f-y0OFm_l8OknaQ1nw.uk182]
2023-03-14 03:40:22 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [7LU2MCm2O-ilPAJryJlEHw.uk6]
2023-03-14 03:40:22 1pbtWF-00GKY0-3C == [email protected] R=dkim_lookuphost T=dkim_remote_smtp defer (-44) H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [7LU2MCm2O-ilPAJryJlEHw.uk6]
2023-03-14 03:53:20 1pbtWF-00GKY0-3C == [email protected] routing defer (-52): retry time not reached
2023-03-14 04:05:59 1pbtWF-00GKY0-3C Sender identification U=myusename D=mydomain.xyz S=[email protected]
2023-03-14 04:06:00 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [XX.220.42.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [dchJ7z8WMiC0ioS7xGthgg.uk67]
2023-03-14 04:06:00 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [OyjhTL_UO3-lVccZaMLDjw.uk188]
2023-03-14 04:06:00 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [YY.ZZ.42.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [Yn88SoMcNauu0VibMfLtrQ.uk103]
2023-03-14 04:06:00 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [YY.ZZ.42.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [3jNEK4faPr-f7j_3fRDl3g.uk169]
2023-03-14 04:06:01 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [AWlo6flbP6SYD9yFbXlKMA.uk92]
2023-03-14 04:06:01 1pbtWF-00GKY0-3C == [email protected] R=dkim_lookuphost T=dkim_remote_smtp defer (-44) H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [AWlo6flbP6SYD9yFbXlKMA.uk92]
2023-03-14 04:21:04 1pbtWF-00GKY0-3C Sender identification U=myusename D=mydomain.xyz S=[email protected]
2023-03-14 04:21:04 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [QJooGDhtOXiDYuM4OwAu9w.uk322]
2023-03-14 04:21:04 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [XX.220.42.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [MFmhpUYPOMOrLgKlHUXPhA.uk197]
2023-03-14 04:21:04 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [YY.ZZ.42.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [Q50ftx1GPRe25xfmPvQt1g.uk147]
2023-03-14 04:21:05 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [YY.ZZ.42.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [339IjVrqNwejhp5tSR3zbQ.uk41]
2023-03-14 04:21:05 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [TuLJSbFsOIGd9iXdDQh6mg.uk250]
2023-03-14 04:21:05 1pbtWF-00GKY0-3C == [email protected] R=dkim_lookuphost T=dkim_remote_smtp defer (-44) H=eu-smtp-inbound-1.mimecast.com [MM.NN.217.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [TuLJSbFsOIGd9iXdDQh6mg.uk250]
2023-03-14 04:44:43 1pbtWF-00GKY0-3C Sender identification U=myusename D=mydomain.xyz S=[email protected]
2023-03-14 04:44:43 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [MM.NN.217.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [HPg71YYUMp2-_iPTom6fNg.uk44]
2023-03-14 04:44:44 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [XX.220.42.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [z0U-vIlHOW6AlzpnHszcWw.uk37]
2023-03-14 04:44:44 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [YY.ZZ.42.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [bhFmN8xdMjW_gJkfyUgi2w.uk99]
2023-03-14 04:44:44 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [MM.NN.217.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [MoT7YnWQM2yImekvggphsQ.uk38]
2023-03-14 04:44:44 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [YY.ZZ.42.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [mhO9SHL-N02eiaE2KX7lVg.uk85]
2023-03-14 04:44:44 1pbtWF-00GKY0-3C == [email protected] R=dkim_lookuphost T=dkim_remote_smtp defer (-44) H=eu-smtp-inbound-2.mimecast.com [YY.ZZ.42.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [mhO9SHL-N02eiaE2KX7lVg.uk85]
2023-03-14 04:51:02 1pbtWF-00GKY0-3C == [email protected] routing defer (-52): retry time not reached
2023-03-14 05:06:01 1pbtWF-00GKY0-3C == [email protected] routing defer (-52): retry time not reached
2023-03-14 05:23:13 1pbtWF-00GKY0-3C == [email protected] routing defer (-52): retry time not reached
2023-03-14 05:38:19 1pbtWF-00GKY0-3C == [email protected] routing defer (-52): retry time not reached
2023-03-14 05:57:30 1pbtWF-00GKY0-3C Sender identification U=myusename D=mydomain.xyz S=[email protected]
2023-03-14 05:57:30 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [MM.NN.217.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [_eqejO5RNXKRpxZbREWDSA.uk272]
2023-03-14 05:57:30 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [YY.ZZ.42.211]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [qhLbUww7Pp6eYAJlXKt1GA.uk219]
2023-03-14 05:57:30 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [YY.ZZ.42.241]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [aSl2KagEPYCAyjHLQRRB4A.uk279]
2023-03-14 05:57:30 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [MM.NN.217.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [PiWGjidIPKeCazQcwBWWcA.uk254]
2023-03-14 05:57:31 1pbtWF-00GKY0-3C H=eu-smtp-inbound-2.mimecast.com [XX.220.42.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [tNn1nhaZOYa9QAHtEYxYJA.uk249]
2023-03-14 05:57:31 1pbtWF-00GKY0-3C == [email protected] R=dkim_lookuphost T=dkim_remote_smtp defer (-44) H=eu-smtp-inbound-2.mimecast.com [XX.220.42.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [tNn1nhaZOYa9QAHtEYxYJA.uk249]
2023-03-14 06:06:02 1pbtWF-00GKY0-3C == [email protected] routing defer (-52): retry time not reached
2023-03-14 06:21:00 1pbtWF-00GKY0-3C == [email protected] routing defer (-52): retry time not reached
2023-03-14 06:36:03 1pbtWF-00GKY0-3C == [email protected] routing defer (-52): retry time not reached
2023-03-14 06:51:00 1pbtWF-00GKY0-3C == [email protected] routing defer (-52): retry time not reached
2023-03-14 07:10:22 1pbtWF-00GKY0-3C Sender identification U=myusename D=mydomain.xyz S=[email protected]
2023-03-14 07:10:22 1pbtWF-00GKY0-3C ** [email protected] R=enforce_mail_permissions: Domain mydomain.xyz has exceeded the max defers and failures per hour (5/5 (100%)) allowed. Message discarded.
2023-03-14 07:10:22 cwd=/var/spool/exim 7 args: /usr/sbin/exim -t -oem -oi -f <> -E1pbtWF-00GKY0-3C
2023-03-14 07:10:22 1pbxra-00GfZ9-1t <= <> R=1pbtWF-00GKY0-3C U=mailnull P=local S=26943 T="Mail delivery failed: returning message to sender" for [email protected]
2023-03-14 07:10:22 1pbtWF-00GKY0-3C Completed
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
Thanks for the additional details. That does indicate you're using the defaults and the retry settings and timeframes have not been customized.

I believe this log entry is the most critical portion:

Code:
 2023-03-14 02:32:02 1pbtWF-00GKY0-3C H=eu-smtp-inbound-1.mimecast.com [XX.220.42.201]: SMTP error from remote mail server after RCPT TO:<[email protected]>: 451 Account inbounds disabled - Customer Community [Z7WX4CXSMo-2lZ5pOAalsw.uk71]
That indicates the place you are trying to email can't handle your message at this time. Here is more information from their error page documentation: Customer Community

Is this a mailing list of some sort where multiple addresses are sent? From the output you've included, it doesn't look like the problem is on your machine.

You can always manually clear the retry database for Exim if you think that is causing issues by running the following commands:

Code:
/usr/sbin/exim_tidydb -t 1d /var/spool/exim retry > /dev/null
/usr/sbin/exim_tidydb -t 1d /var/spool/exim reject > /dev/null
/usr/sbin/exim_tidydb -t 1d /var/spool/exim wait-remote_smtp > /dev/null
 

plumdesign

Member
Feb 15, 2023
16
2
3
Belgrade
cPanel Access Level
Root Administrator
thank you for reply.
"Is this a mailing list of some sort where multiple addresses are sent?" - it is mail list, but the mail subscribers PAY for getting mail, so there is a poor chance to label that mail messages as spam - they are confidental and copyrighted. the CRON triggers 6 mails per minute so there is no massive emission of mail. Due to unknown reason the first message (regular or bulk mail) with greylisting or similar cause instant problem ob blocking outbound mails -an whole company cannot send e-mails. We are catching bounces and remove them on weekly basis (blacklisted, non-existing etc.).


so the question is IF (That indicates the place you are trying to email can't handle your message at this time.) THEN why my outgoing mail is blocked?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
Thanks for the additional details - that's exactly what I wanted to know.

When this block happens, what do you see in the Exim log when you try a different outgoing message? You can run "tail -f /var/log/exim_mainlog" while sending a standard message from Webmail to an external address to see if that is delivered normally, or if Exim gives a specific error.
 

KJ

Active Member
Feb 15, 2006
36
3
158
Hello,

Please forgive me if i get off topic.

We've been getting this issue for years now and it also happened today.

For various reasons a legit mail does not get delivered to its recipient so the server tries again for 4 more times to send it. When this was happening, it was triggering the "max defers per hour" block. We ended up raising the default limit from 5 failures to 15 and also raising the "Maximum percentage of failed or deferred messages a domain may send per hour" from 20% to the default 60%. Occasionally it still happens (2-3 times per month). We explain the customer that there was an issue with the recipient at the moment of the sending but we have not found an explanation yet on why the server tries again and again to send the message.

Is there any way we reduce the retries to just 2 or have the mail server repeat the retries after X amount of time? We would be satisfied if we could find a solution to this chronic issue so that we could reduce the limits mentioned above to the ones we had originally established.

Thank you.
 

plumdesign

Member
Feb 15, 2023
16
2
3
Belgrade
cPanel Access Level
Root Administrator
Hi I have fixed the problem - BUT PLEASE BE CAREFUL. Here are steps:

1. cp /etc/exim.conf /etc/exim.conf.backup

2. nano /etc/exim.conf

3. Find the following lines (warning the order of commands is important)

dkim_lookuphost:
driver = dnslookup
domains = ! +local_domains
condition = "${perl{sender_domain_can_dkim_sign}}"
ignore_target_hosts = +loopback : 64.94.110.0/24
headers_add = "${perl{mailtrapheaders}}"
.ifdef SRSENABLED
transport = ${if eq {$local_part@$domain} \
{$original_local_part@$original_domain} \
{dkim_remote_smtp} {dkim_remote_forwarded_smtp}}
.else
transport = dkim_remote_smtp
.endif



4. Right after this ADD following:


retry:
driver = retry
retry_use_sender = true
retry_max_time = 10800

5. restart EXIM


Please provide here feedback if this works for you (i did it myself and the problem is fixed). It appears that DEFAULT configuration of EXIM is wrong in this scenario.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
@plumdesign - while that may work temporarily, those changes will likely be overwritten.

You should never edit the exim.conf file directly, but instead you would want to use the Advanced Editor in WHM >> Exim Configuration manager: Exim Configuration Manager | cPanel & WHM Documentation

This will ensure the files are modified in a way they are not overwritten by cPanel.

As far as the default configuration being incorrect, it does work well for a vast majority of users, but your needs could be different.
 

plumdesign

Member
Feb 15, 2023
16
2
3
Belgrade
cPanel Access Level
Root Administrator
@plumdesign - while that may work temporarily, those changes will likely be overwritten.
Thanks for highlighting this. That's the life. This problem lead to 33 of our clients run away from mail services to Office365. They do not want explainations of EXIM configurations - they want mails to be send in any moment.

You should never edit the exim.conf file directly, but instead you would want to use the Advanced Editor in WHM >> Exim Configuration manager: Exim Configuration Manager | cPanel & WHM Documentation
There is no option to change this in > Exim Configuration manager (i was unable to even find a place where to modify this) - of course i would never play around with impossible complex EXIM.


As far as the default configuration being incorrect, it does work well for a vast majority of users, but your needs could be different.
I have used to read your great responses. This is not one of them. Serial attempts of sending mail messages after failure response without any control (with completely confuzing error messages for me) triggers server mail send block. Those settings are not balanced. And cPanel made brilliant control of almost anything, but Documentation is poor on this topic. Please show me that I am wrong with exact manual in documentation - how to do this. If somebody dig into the EXIM might find some error in logic. Most of users do not have maybe a way to understand that the problem is present.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
While there may not be a place directly in the main configuration, the Advanced Editor almost certainly has an area where you can apply those configuration values.

Is the main issue you're seeing that the account is being limited for mail? You did post your configuration and we confirmed it is using the defaults of:

Code:
+secondarymx * F,4h,5m; G,16h,1h,1.5; F,4d,8h
* * F,2h,15m; G,16h,1h,1.5; F,4d,8h
This would tell us that a failed message is retried every 15 minutes for the first 2 hours. That would only send 4 failed messages per hour, so if they are hitting the limit of 5 per hour, there must be multiple messages being sent that are failing.

You are welcome to adjust the retry time in Exim to better fit your needs by changing the line to something like this so it only tries to resend twice per hour:

Code:
* * F,2h,30m; G,16h,1h,1.5; F,4d,8h
[/CODE]

or you could limit that even further if you want.
 
  • Like
Reactions: plumdesign and KJ

KJ

Active Member
Feb 15, 2006
36
3
158
You are welcome to adjust the retry time in Exim to better fit your needs by changing the line to something like this so it only tries to resend twice per hour:

Code:
* * F,2h,30m; G,16h,1h,1.5; F,4d,8h
or you could limit that even further if you want.
Thank you for being more specific in your response.

Which of these numbers do i need to change to raise the retry time from 0 seconds (it makes the retries the one after the other) to 5 minutes/300 seconds?
 
  • Like
Reactions: plumdesign

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
I'm not sure I understand the question - there isn't anything in Exim that retries at zero seconds.

If a message fails, Exim checks the retry function, which is that line in the configuration file. The default is this:

Code:
* * F,2h,15m; G,16h,1h,1.5; F,4d,8h
That says that for the first 2 hours after the message has failed, the server will retry sending every 15 minutes. In my example, above, changing that value to 30m increases that time to every 30 minutes. Does that help?
 

KJ

Active Member
Feb 15, 2006
36
3
158
A bit but doesn't answer my original concern. If Exim doesn't retry at zero seconds, then is it the mail client? Cause over the years i've seen this happening certainly a few dozen times. Email fails as Track Delivery shows and at 0 seconds there are 4 more failed attempts to send the email.
 

plumdesign

Member
Feb 15, 2023
16
2
3
Belgrade
cPanel Access Level
Root Administrator
"This would tell us that a failed message is retried every 15 minutes for the first 2 hours. That would only send 4 failed messages per hour, so if they are hitting the limit of 5 per hour, there must be multiple messages being sent that are failing."

This exactly was to problem. These settings are clear and they had been set.But in some cases server tries 20 to 30 times in 0 seconds to resend the same mail and instantly block. And this is common problem on all servers that use cPanel.The problem is rare but in large companies with many mail accounts it happens often, and also the clients who send bulk mail.

After applied the temporary fix -the problem did not appear ever.