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.

How to reduce hold time in Mail Queue?

Discussion in 'E-mail Discussions' started by brianteeter, Dec 12, 2002.

  1. brianteeter

    brianteeter Well-Known Member

    Joined:
    Jan 6, 2002
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    6
    One of our servers has a constant bucket of 2000+ messages sitting in the mail queue. This is due to users who setup bogus mail addresses to signup for things, that then get used. So, for instance, there could be a dozen or so messages to an address like:

    no-spam@oneofourcustomers.com

    While there is no problem doing this, I want to keep the queue size down. Is there a way to reduce the time messages are held in the queue from 7 days to say 24 hours?

    Thanks - Brian
     
  2. bjarne

    bjarne Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    /etc/exim conf

    I suppose you can change this value in the config file
     
  3. JustinK

    JustinK Well-Known Member

    Joined:
    Sep 4, 2001
    Messages:
    251
    Likes Received:
    0
    Trophy Points:
    16
    As bjarne said, that value's in the /etc/exim.conf file:

    timeout_frozen_after = 7d

    Also, if your users are giving bad addresses, tell them to use :fail: or :blackhole: so that it doesn't clog up your mail queue. You'll still get some clogging with it, but not as much. Best to have them use :blackhole: unless they really need mail to bounce.
     
  4. Skm74

    Skm74 Well-Known Member

    Joined:
    Sep 28, 2002
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    What is :blackhole?
     
  5. ThunderHostingDotCom

    ThunderHostingDotCom Well-Known Member

    Joined:
    Nov 18, 2002
    Messages:
    450
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    All over!
    [quote:ee64cd72c3][i:ee64cd72c3]Originally posted by Skm74[/i:ee64cd72c3]

    What is :blackhole?[/quote:ee64cd72c3]


    I think :blackhole: is when the email is just deleted where as :fail: will send a bounced email back to the sender saying that it was an invalid email.
     
  6. ThunderHostingDotCom

    ThunderHostingDotCom Well-Known Member

    Joined:
    Nov 18, 2002
    Messages:
    450
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    All over!
    [quote:e97d96d6b1][i:e97d96d6b1]Originally posted by JustinK[/i:e97d96d6b1]

    As bjarne said, that value's in the /etc/exim.conf file:

    timeout_frozen_after = 7d

    Also, if your users are giving bad addresses, tell them to use :fail: or :blackhole: so that it doesn't clog up your mail queue. You'll still get some clogging with it, but not as much. Best to have them use :blackhole: unless they really need mail to bounce.[/quote:e97d96d6b1]

    Ok, I have a few questions...
    1) If I make this change will it get overwritten on the next cPanel update?
    2) How do I set all accounts created to use :fail: by default?
     
  7. ThunderHostingDotCom

    ThunderHostingDotCom Well-Known Member

    Joined:
    Nov 18, 2002
    Messages:
    450
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    All over!
    [quote:6d1a1b02c8][i:6d1a1b02c8]Originally posted by JustinK[/i:6d1a1b02c8]

    As bjarne said, that value's in the /etc/exim.conf file:

    timeout_frozen_after = 7d

    Also, if your users are giving bad addresses, tell them to use :fail: or :blackhole: so that it doesn't clog up your mail queue. You'll still get some clogging with it, but not as much. Best to have them use :blackhole: unless they really need mail to bounce.[/quote:6d1a1b02c8]

    Ok, I have a few questions...
    1) If I make this change will it get overwritten on the next cPanel update?
    2) How do I set all accounts created to use :fail: by default?
     
  8. JustinK

    JustinK Well-Known Member

    Joined:
    Sep 4, 2001
    Messages:
    251
    Likes Received:
    0
    Trophy Points:
    16
    1) Probably. I made a change awhile back (a long time ago) and it got overwritten, but I haven't made any changes since it got switched back so I can't confirm it.

    2) If you mean the default address you would have to check the script used for creating accounts so you could change the info put into the valias file when an account is created. That is unless that's part of the scripts2 directory which is basically a call to the cpanel api I believe.

    :blackhole: is as said above. It just eats up mail without sending anything out. :fail: will bounce a message (note: commands must be lowercase and must have the colon on each side). The difference is, the server will keep trying to bounce the message back so if the sender sent something fake or it's unable to be delivered, your mail queue will still be stuck trying to process it until the time comes to give it up.
     
  9. dandanfireman

    dandanfireman Well-Known Member
    PartnerNOC

    Joined:
    May 31, 2002
    Messages:
    117
    Likes Received:
    0
    Trophy Points:
    16
    Just to reiterate what the previous post said, :fail: is a REALLY bad idea. Most spam is sent with bogus from messages. This will cause your mail queue to fill much too full with messages that can't be delivered, making your problem worse. We do not allow users to use :fail: for that reason.
     
  10. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    I am trying to edit exim.conf to change this value:

    from: timeout_frozen_after = 7d
    to: timeout_frozen_after = 4d

    To make the queue only 4 days.

    However, when I use the WHM Exim config editor, after making the change, I get the following error:

    Exim version 4.24 #1 built 29-Sep-2003 02:43:17
    Copyright (c) University of Cambridge 2003
    Berkeley DB: Sleepycat Software: Berkeley DB 4.0.14: (November 18, 2001)
    Support for: iconv() PAM Perl OpenSSL
    Authenticators: cram_md5 plaintext spa
    Routers: accept dnslookup ipliteral manualroute queryprogram redirect
    Transports: appendfile autoreply pipe smtp
    Configuration file is /etc/exim.conf.buildtest
    `/etc/exim.conf.buildtest' -> `/etc/exim.conf'
    cp: cannot remove `/etc/exim.conf': Operation not permitted

    ??

    - Scott
     
  11. cyberspirit

    cyberspirit BANNED

    Joined:
    Jun 27, 2003
    Messages:
    293
    Likes Received:
    0
    Trophy Points:
    0
    Here is how you do it:
    (the previous posts suggested changing a default which actually does not work!)

    In the last part of your exim.conf file (use the advanced exim configuration editor in whm) go to the very end and find this part:

    ######################################################################
    # 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




    You will then see two edit boxes. Fill this here in the first edit box and save:


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


    What this does is that it deletes messages with a refuse error (see exim docs) after a maximum of 36hours and all other messages in the mailqueue after 2 days (48 hours).

    On top please see the other thread I wrote about getting Exim to reject messages to unknown recipients which will cut down in messages in your outgoing queue.
    URL=http://forums.cpanel.net/showthread.php?s=&threadid=17311
    why?
    Because right now Exim accepts every incoming message for a local address. It then checks if the recipient is valid. If it is not valid it sends an error message. If the original message was spam and the sender's address fake then you can imagine that the error message will sit forever in your outgoing queue.
    With my changed setup Exim will not even accept a message if the recipient is not valid and therefore not create a real message in the outqueue.

    Hope this helps
     
    #11 cyberspirit, Nov 27, 2003
    Last edited: Nov 27, 2003
  12. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    Thanks Cyberspirit, this is excellent information, and should be added to the "How To" Sticky for all future users. Perhaps even cPanel should make your suggestion the default!

    Now, any ideas why I can no longer edit my exim.conf file? (see my post above for the error). Even if I try to edit it in VI, it says "read only" at the bottom and I cannot make changes.

    - Scott
     
  13. cyberspirit

    cyberspirit BANNED

    Joined:
    Jun 27, 2003
    Messages:
    293
    Likes Received:
    0
    Trophy Points:
    0
    Scott,
    Did you edit exim.conf manually in the past? What are the permissions on the file?
    You could just rename the exim.conf and see if it works because the exim advanced editor in whm creates an exim.conf.buildtest file that is then copied into the exim.conf file. There might be a permission problem I would guess.
     
  14. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    Yes, I did edit the file once before, to do some other suggested changes to make mailman and exim work together better. But I can't remember if I used vi or if I used the WHM config editor.

    the permissions are rw-r--r--

    When I try to chmod to something else, I get permission denied also !!!

    Thanks, I'll try the rename.

    - Scott
     
  15. cyberspirit

    cyberspirit BANNED

    Joined:
    Jun 27, 2003
    Messages:
    293
    Likes Received:
    0
    Trophy Points:
    0
    Scott,
    I checked on my system and exim.conf and exim.conf.buildtest are both rw-r--r-- root root
    Hope this helps.
     
  16. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    Doh! I'm a bone head. In another thread, someone suggested a way to make mailman and exim play better, and part of his "step by step" instructions was to chattr the file to +i, making it read-only. I did a chattr -i exim.conf and all is well.

    Thanks for the reply!

    -Scott
     
Loading...

Share This Page