Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default How can I flush the email queue?

    Someone recently said our server email queue contains very old email and that we should flush it. This is probably an easy proceedure, I am not sure how to do it?

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Theoreticaly the following should work:

    exim -qff

    It doesn't always do very much. If you're using MailScanner, also try:

    exim -qff -C /etc/exim_outgoing.conf
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default

    Thanks, but does this flush the entire queue? Live/current email and all? Or just the really old/dormant stuff?

  4. #4
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    There's also a nice script here that will give you a little control over what you flush...

    WHM Clean Mail Queue script

  5. #5
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    Quote Originally Posted by verdon
    There's also a nice script here that will give you a little control over what you flush...

    WHM Clean Mail Queue script
    I like that script.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  6. #6
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    I thought you might It's a nice script.

    FYI... I found a nice tip here that helped me put the script in the add-ons section of WHM nicely and properly. I only had to add a couple lines to the script near the top...
    Code:
    #WHMADDON:cleanmailqueue:Clean Mail Queue
    
    BEGIN {
       push(@INC,"/usr/local/cpanel");
       push(@INC,"/usr/local/cpanel/whostmgr/docroot/cgi");
    }
    ...and rename the script to addon_PWScleanmailqueue.cgi
    ...and change the post url at line 106 to match the new name

    Now the script is where I want it in WHM, and the link to it has not been lost in cPanel/WHM updates.

  7. #7
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    I know. That's what I'm working on, when I get a bit of free time. I'm going to switch all my WHM scripts to that and once the switch is made, all WHM scripts will be members only ones. I think I may actually have time to do that this weekend.


    Quote Originally Posted by verdon
    I thought you might It's a nice script.

    FYI... I found a nice tip here that helped me put the script in the add-ons section of WHM nicely and properly. I only had to add a couple lines to the script near the top...
    Code:
    #WHMADDON:cleanmailqueue:Clean Mail Queue
    
    BEGIN {
       push(@INC,"/usr/local/cpanel");
       push(@INC,"/usr/local/cpanel/whostmgr/docroot/cgi");
    }
    ...and rename the script to addon_PWScleanmailqueue.cgi
    ...and change the post url at line 106 to match the new name

    Now the script is where I want it in WHM, and the link to it has not been lost in cPanel/WHM updates.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  8. #8
    Member
    Join Date
    Nov 2005
    Posts
    57

    Default Many frozen message in queue

    My mail queue now has over 750 messages "frozen" in it. If I attempt to deliver any of them automatically or manually, I get the reason why they have not gone through (user unknown, invalid recipient, etc) but WHY can't I force the mails all the way out so that the SENDER receives back a message as to why it failed or rejected? If I delete the queue, the sender's (my clients) will assume their mails were delivered.

    Am I correct?

  9. #9
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    If you delete messages in the queue, the sender thinks it was sent and the recipient never gets it, but 99% of messages in the queue for more than a few days are either spam with invalid return addresses, or going to an account that is over it's limit.

    With my "clean mail queue" script, you can delete all emails over 3 days old which is pretty safe.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  10. #10
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    the more important question is why do you have so many in the queue to begin with? I never have more than a few stuck in the queue. This number suggests that somebody is spamming through you server, or these is some other weakness in your setup.

  11. #11
    Member
    Join Date
    Nov 2005
    Posts
    57

    Default

    Quote Originally Posted by verdon
    the more important question is why do you have so many in the queue to begin with? I never have more than a few stuck in the queue. This number suggests that somebody is spamming through you server, or these is some other weakness in your setup.

    A fair amount of clients forward their emails off to another account, say their ISP. This means that spam intended for that recipient is forwarding off as well. I did look at many mails and see this dilemma. The new receiving server does perceive some of these forwarded mails as spams, and says "no, thank you." I have no trouble deleting those.

    BUT, I do see some valid error messages that should go back to the sender, say invalid recipient. ALSO, all of the mailman lists stopped getting any bounces recently. I am trying to see if this issue is connected. I see "bad" test addresses we have been testing on mailman lists stuck in the queue.

  12. #12
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    Quote Originally Posted by innsites
    A fair amount of clients forward their emails off to another account, say their ISP. This means that spam intended for that recipient is forwarding off as well. I did look at many mails and see this dilemma. The new receiving server does perceive some of these forwarded mails as spams, and says "no, thank you." I have no trouble deleting those.
    I was getting a lot of those too, until I switched to mailscanner. If you're not enabling scanning by default on domains, then strongly encourage users to start doing so. Also, I've found that 99.9% of the stuff flagged as low-level (likely to be) spam is indeed spam, so except in a very few cases, I just have that deleting and not being delivered or forwarded.

    BUT, I do see some valid error messages that should go back to the sender, say invalid recipient. ALSO, all of the mailman lists stopped getting any bounces recently. I am trying to see if this issue is connected. I see "bad" test addresses we have been testing on mailman lists stuck in the queue.
    I'm sorry I can't remember the exact reference, but there is a post in these forums that discusses get mail sent as nobody@host.com (what many webscripts will do) identified as what user it actually was and therefore getting bounces properly delivered.

    Good luck,

    One more thing, some of those invalid recipient bounces may also be from fwd'ed spam bouncing. I know a couple instance for sure where the recipient is valid, but spam sent to that address will bounce with an invalid recipient error.
    Last edited by verdon; 01-29-2006 at 12:59 PM.

Similar Threads & Tags
Similar threads

  1. Email queue size alert - The exim delivery queue size is 3013
    By SecondSight in forum E-mail Discussions
    Replies: 2
    Last Post: 10-16-2009, 12:31 AM
  2. Flush my dns cache
    By ramjet666 in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 11-14-2007, 07:56 AM
  3. Flush cPHulk db from shell?
    By internetfab in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-11-2007, 04:58 AM
  4. Email in Queue
    By moogle in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 12-27-2003, 01:19 PM
  5. eMAIL queue
    By shazad in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 12-04-2002, 10:02 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube