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.

Retry email settings?

Discussion in 'E-mail Discussions' started by compliancelc, Jun 24, 2009.

  1. compliancelc

    compliancelc Member

    Joined:
    Jun 23, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  2. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    I believe you can find it in advanced exim configuration editor. Search for "retry configuration" This should be the section.

     
  3. gkgcpanel

    gkgcpanel Well-Known Member

    Joined:
    Jun 6, 2007
    Messages:
    217
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    Doesn't seem to be following that rule...

    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?
     
  4. compliancelc

    compliancelc Member

    Joined:
    Jun 23, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  5. compliancelc

    compliancelc Member

    Joined:
    Jun 23, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  6. compliancelc

    compliancelc Member

    Joined:
    Jun 23, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    bump.....anyone?
     
  7. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    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? ;)
     
    #7 Kent Brockman, Jul 1, 2009
    Last edited: Jul 1, 2009
  8. compliancelc

    compliancelc Member

    Joined:
    Jun 23, 2009
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Thankyou, Thankyou, Thankyou!

    Awesome post, all is working great now
     
  9. jshanley

    jshanley Member

    Joined:
    Jul 1, 2003
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    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:
    root@galaxy [/etc]# cat exim.conf.local
    @AUTH@
    
    @BEGINACL@
    
    @CONFIG@
    ignore_bounce_errors_after = 6h
    timeout_frozen_after = 5h
    auto_thaw = 23h
    deliver_queue_load_max = 5
    @DIRECTOREND@
    
    @DIRECTORMIDDLE@
    
    @DIRECTORSTART@
    
    @ENDACL@
    
    @RETRYEND@
    
    @RETRYSTART@
    * rcpt_4xx            F,12h,30m
    * timeout             F,4h,30m
    * refused             F,1h,20m
    * lost_connection     F,1h,20m
    * *                   F,4h,30m
    @REWRITE@
    
    @ROUTEREND@
    
    @ROUTERSTART@
    
    @TRANSPORTEND@
    
    @TRANSPORTMIDDLE@
    
    @TRANSPORTSTART@
    
    
    
    
     
Loading...

Share This Page