compliancelc

Member
Jun 23, 2009
12
1
51
Hi There,

Can anyone tell me how to set the maximum retries to 2 or 3 times maximum before they are added to a failed retries folder or similar?

Is it possible to make different settings on the retries for different domains?

I am trying to make sure the mail queue doesn't keep filling up.

regards,

Dave
 
  • Like
Reactions: Gino Viroli

JawadArshad

Well-Known Member
PartnerNOC
Apr 8, 2008
459
6
68
PK
cPanel Access Level
DataCenter Provider
Hi There,

Can anyone tell me how to set the maximum retries to 2 or 3 times maximum before they are added to a failed retries folder or similar?

Is it possible to make different settings on the retries for different domains?

I am trying to make sure the mail queue doesn't keep filling up.

regards,

Dave
I believe you can find it in advanced exim configuration editor. Search for "retry configuration" This should be the section.

######################################################################
# RETRY CONFIGURATION #
######################################################################

# This single retry rule applies to all domains and all errors. It specifies
# retries every 15 minutes for 2 hours, then increasing retry intervals,
# starting at 1 hour and increasing each time by a factor of 1.5, up to 16
# hours, then retries every 8 hours until 4 days have passed since the first
# failed delivery.

# Domain Error Retries
# ------ ----- -------


begin retry




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

gkgcpanel

Well-Known Member
Jun 6, 2007
214
1
166
cPanel Access Level
DataCenter Provider
Doesn't seem to be following that rule...

I believe you can find it in advanced exim configuration editor. Search for "retry configuration" This should be the section.
I see in the exim_mainlog file that on the 16th of June a message was sent, (one attempt) it was returned from the receipient's server for greylisting (which is fine), and that if a retry happens within an hour, it will then go through.

No retries found, until 5 days later, it tries one more time, and again fails for greylisting, and then is cancelled and bounced saying retry time exceeded.

So, it certainly did not try again every 15 minutes for the first 2 hours, etc...

Anyone have any ideas?
 
  • Like
Reactions: Gino Viroli

compliancelc

Member
Jun 23, 2009
12
1
51
Is there a way to change it from

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

to just

* * F,2h,15m;

and then have it store the frozen emails somewhere to be downloaded?

in the editor i see one box above and one below this entry
* * F,2h,15m; G,16h,1h,1.5; F,4d,8h

but I cant seem to edit it?


Dave
 

compliancelc

Member
Jun 23, 2009
12
1
51
Also I now see the following

There are currently 9136 messages in the mail queue.

A lot of these are ill written addresses such as hoymail.com aool.com etc.

I see some have been in the queue for 5 days and are still not being marked as frozen and deleted from the queue? Why is this? Is there a way I can make them go to frozen and be saved elsewhere after just 1 day of retries?

Dave
 

Kent Brockman

Well-Known Member
PartnerNOC
Jan 20, 2008
1,255
60
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
Detailed How-To

Hi there. I had the same odd problem some time ago, and after reading a lot the exim docs, I got the solution and now it is working like a breeze, with no more than 15 messages in the queue at the same time (well, may you find more messages if some customers send massive newsletters or if using news groups, but then, they never will be more than 600 in a given time ;) ).
Hope this helps, since I wanted to share this since some time ago.


At first, you need to know that every time you click Save on the cPanel Exim Config Editor, the entire Exim config file is fully rewritten. So, if you manually change anything there, it will be lost next time you save the Exim config from WHM. cPanel builds the Exim config file (/etc/exim.conf) using templates. This is why you must know them and repeat the modifications in all of them.

I found that the bullet proof method to customize your retry times is to touch those elements in the templates which cPanel only use to copy and paste to build the final config. You can modify the below values to what better fit in your scenario. The only way to test different values without letting cPanel overwrite them is to edit exim.conf and restart exim via SSH.

I like to edit using pico: pico /etc/exim.conf
Now, scroll down (Pg Down) till the end of the file. You'll find the default
Code:
* * F,2h,15m; G,16h,1h,1.5; F,4d,8h
The problem with this concept is that make generalizations, dealing with every error in the same way. But you and me know that every bounce error have not born equal ;)

Well, to deal with my daily scenario, I replaced the default settings for this one:

Code:
[FONT="Courier New"]* rcpt_4xx            F,12h,30m
* timeout             F,4h,30m
* refused             F,1h,20m
* lost_connection     F,1h,20m
* *                   F,4h,30m[/FONT]
This makes sense to better handle different situations:
  • Yahoo, AOL and graylisted messages receiving 4xx error, will retry every 30 minutes during 12 hs because sooner or later, they will arrive to their destinations. It's only a matter of patience.
  • Destination domains which returns timeout in connection may be due to the domain gone down, or maybe some antispam systems returning a camouflaged error. So, I CONSIDER that there is no reason to hammer the destination for more than 4 hs. Also, a timeout connection consume memory and we don't want to waste resources.
  • Refused connections may effectively be due to antispam blocks. 10% may be due to greylisting. That's why I'll retry them for no more than 1 hr.
  • Lost connections too. May be an antispam, may be a blackhole... I don't want to waste CPU time with them.
  • And for all the remaining error situations, just keep trying every 30 minutes during 4 hs. Since the most common errors have been already addressed, I THINK that retrying with these for more than 4 hrs is a nonsense.

You think this was great, but there is more to read..

Scroll up! Till the first screen of exim.conf at the very beginning. Locate these variables and change its values:

Code:
ignore_bounce_errors_after = 6h
timeout_frozen_after = 5h
auto_thaw = 23h
deliver_queue_load_max = 3
This will reinforce the retry times with behavioural settings. The variable names are self-explanatory as you can see ;)

These changes will sum up to better process messages without wasting resources in queuing.

BUT there are mooore facts to pay attention to.

Till here, you know how to improve the queue work. But, the next time you save Exim configuration from cPanel, all this job will be lost. To prevent this, you'll need to repeat all these changes in the template files at /etc/exim.conf* (there are about 5 files). That way, you'll have covered the templates that cPanel uses to build the final config file.
But you better first test changing only the exim.conf and restarting exim service thru SSH command line.


And before letting you go... There's is something more you need to know: the next time you run eximup, or next time you upgrade cPanel, all the templates will be upgraded too and obviously reset to their defaults, so you'll need to redo all this job again... and again. Isn't that great? ;)
 
Last edited:
  • Like
Reactions: Gino Viroli

jshanley

Member
Jul 1, 2003
7
1
151
Till here, you know how to improve the queue work. But, the next time you save Exim configuration from cPanel, all this job will be lost. To prevent this, you'll need to repeat all these changes in the template files at /etc/exim.conf* (there are about 5 files). That way, you'll have covered the templates that cPanel uses to build the final config file. <snip> And before letting you go... There's is something more you need to know: the next time you run eximup, or next time you upgrade cPanel, all the templates will be upgraded too and obviously reset to their defaults, so you'll need to redo all this job again... and again. Isn't that great? ;)
Hi Kent,

You can just save these changes in the 'local' Exim config file, which is written by the Exim Advanced Configuration Editor. See below for an example; settings in exim.conf.local are saved after updates, and are the preferred way to modify the config.

Code:
[email protected] [/etc]# cat exim.conf.local
@[email protected]

@[email protected]

@[email protected]
ignore_bounce_errors_after = 6h
timeout_frozen_after = 5h
auto_thaw = 23h
deliver_queue_load_max = 5
@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]
* rcpt_4xx            F,12h,30m
* timeout             F,4h,30m
* refused             F,1h,20m
* lost_connection     F,1h,20m
* *                   F,4h,30m
@[email protected]

@[email protected]

@[email protected]

@TRANSPOR[email protected]

@[email protected]

@[email protected]
 
  • Like
Reactions: Gino Viroli