Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Jan 2005
    Posts
    71

    Default How to stop deleting "Delete Mail Queue"

    this process is going very long time.
    & how can i stop it with manual?

  2. #2
    Member
    Join Date
    May 2004
    Location
    Home is Baltimore, MD - Currently in the Philippines
    Posts
    62

    Default

    Quote Originally Posted by rip_curl
    this process is going very long time.
    & how can i stop it with manual?
    If you have over 1k messages in queue and want to nuke them its best to :

    1 - stop chkservd from restarting exim when you stop it in step 2 (/etc/init.d/chkservd stop)
    2 - stop exim (/etc/rc.d/init.d/exim stop)
    3 - Nuke the queue yourself:

    cd /var/spool/exim/input

    You'll see a directory for every case of every letter that has a corresponding message id beginning with that letter.

    just rm -rf * then re-start exim, or use a utility like find to just remove messages over xx minutes old (past 90-120 mins would be a good candidate).

    Cpanel's utility removes the queue without actually taking exim down, which takes much longer and is impractical when cleaning out a huge queue (and not too load friendly either)

    Even if you're removing the queue, once an hour every hour exim is going to try to deliver them. If the mail queue is huge you're better off doing it through ssh.

    I wrote this a while ago and never posted it anywhere (actually forgot I had it) which can help keep exim's queue from looming too big.

    Code:
    #!/bin/bash
    
    # Simple Exim Queue Cleaner
    # copyrighting this would be pitiful.
    
    # Set trip for however many minutes a queued message should be allowed to live ... 
    
    trip=120
    counter=0
    
    [ -d "/var/spool/exim/input" ] || exit 1
    
    echo "Scanning exim's queue for messages aging at or over $(($trip +1 )) minutes."
    cd /var/spool/exim/input
    for message in `find ? -cmin +$trip -print`; do
      if [ -f "$message" ]; then
        let "counter += 1"
        if [ "$1" = "--show" ]; then
          echo -en "$message\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"
        fi
        rm -f $message`
        let "i += 1"
      fi
    done
    let "i = $i / 2"
    echo "Done. $i stale emails nuked."
    This is gentle enough to run via cron to help keep your queue from getting that big. Paste into a file and chmod +x ... I'd run it 2 - 3 times a day on servers that tend to get a bunch of incoming or reciprocal junk.

    The above takes a --show as argv[1] to produce output as it goes, else just send to /dev/null in a cron with no arguments.

    HTH


    This is probably obvious, but just in case I've edited the post to add :

    don't forget to restart chkservd
    Last edited by netkinetics; 02-09-2006 at 03:55 AM. Reason: Doup! Forgot to tell ya
    Serverbalance - Custom Clusterd Solutions Done Right, Affordably!

  3. #3
    Member
    Join Date
    Jan 2005
    Posts
    71

    Default

    Thank you very much for your posting

    I have one more question can cppop fail because I have over 3 000 mails in queue?

  4. #4
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Nov 2003
    Location
    moscow
    Posts
    294

    Default

    no. it cannot.
    https://robobill.net
    US dedicated, Europe and Asia and Russia dedicated server. Shared, Reseller, VPS hosting in US and Europe.
    We are RESELLER of dedicated servers since 2002.

  5. #5
    Member
    Join Date
    Mar 2004
    Posts
    710

    Default

    It is more important to know why your queue is large. Spammers on your server could be one reason among many others.
    Lloyd F Tennison

  6. #6
    Member
    Join Date
    May 2004
    Location
    Home is Baltimore, MD - Currently in the Philippines
    Posts
    62

    Default

    Quote Originally Posted by lloyd_tennison
    It is more important to know why your queue is large. Spammers on your server could be one reason among many others.
    Agreed and I would like to add, the above stuff I posted is just the last line of defense in case you're out having drinks and some ignorant pleab fills up your mail queue.

    An over active queue could come from :

    Spammers
    Hosting forums falling victim to many robot sign ups
    insecure contact forms


    All kinds of wonderful things. exim_mainlog will tell you what you need to know An over active queue is symptomatic of something larger... unless you just have a REALLY full server.
    Serverbalance - Custom Clusterd Solutions Done Right, Affordably!

  7. #7
    Member
    Join Date
    Jan 2005
    Posts
    71

    Default

    i have a "cppop failed" message in my server.
    and users can't connetct to server. what can it be?
    what should I check first?

  8. #8
    Member
    Join Date
    May 2004
    Location
    Home is Baltimore, MD - Currently in the Philippines
    Posts
    62

    Default

    Quote Originally Posted by rip_curl
    i have a "cppop failed" message in my server.
    and users can't connetct to server. what can it be?
    what should I check first?
    You really need to get an admin to look. Something is sending an enormous amount of email and all of the exim (and subsequent processes to catch all the bounces) are preventing other services from forking.

    I would (on a hunch) try

    /usr/sbin/lsof | grep /home as root .. and look for things like email.txt , emails.txt

    If that fails replace home with tmp ..

    You could also try lsof -I (cap i ) and check open inet sockets to see if someone's left you a present sending emails ..

    Someone is abusing your mailer. You need to find out who and null route that MX quickly or the bounced emails will continue to flood the server long after you terminate the account. Hopefully the ttl's aren't too high.

    Step 1 - find them
    Step 2 - Suspend them
    Step 3 - Remove their MX entry right away and reload the zone.
    Step 4 - 40 mins later term the account, and all should stop.

    That should save you the 4 hours (default ttl) of bounced emails coming back at your server.

    If this is a "nobody" spammer (i.e. not sent with anything using suexec) then just term the vhost. There shouldn't be a MX record for the server's hostname .. so once you nuke em it'll quiet down

    Hope this helps Again - I'd get an admin.
    Last edited by netkinetics; 02-10-2006 at 01:59 AM.
    Serverbalance - Custom Clusterd Solutions Done Right, Affordably!

  9. #9
    Member
    Join Date
    Jan 2005
    Posts
    71

    Default

    thank you very much for your help.
    A'm a newbie at this & i wanna to an admin myself.

  10. #10
    Member
    Join Date
    May 2004
    Location
    Home is Baltimore, MD - Currently in the Philippines
    Posts
    62

    Default

    your toolbox for catching a spammer is going to be learning exim's log format, and seeing what you can do with lsof and grep.

    try man lsof (lists open files) to see what you can do. Its a great birds eye view on what everyone has open (and what applications (like exim) are using it.

    Good luck
    Serverbalance - Custom Clusterd Solutions Done Right, Affordably!

Similar Threads & Tags
Similar threads

  1. Replies: 2
    Last Post: 01-08-2011, 05:30 AM
  2. Add "delete list" button in WHM on "Reset a Mailman Password" page
    By cPanelMary in forum Feature Requests for cPanel/WHM
    Replies: 0
    Last Post: 01-08-2011, 12:19 AM
  3. mail queue "connection refused" problem
    By sime in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 05-22-2006, 09:19 AM
  4. "Manage Mail Queue" Problem - "Deliver Now" not working?
    By benskey in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-10-2006, 06:58 AM
  5. "Manage Mail Queue" not showing the que
    By circlec in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-23-2004, 09:40 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube