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.

Delete exim queue via ssh?

Discussion in 'E-mail Discussions' started by bmcpanel, Jul 4, 2006.

  1. bmcpanel

    bmcpanel Well-Known Member

    Joined:
    Jun 1, 2002
    Messages:
    546
    Likes Received:
    0
    Trophy Points:
    16
    Hi. Due to spamming, spoofing from fields, etc., etc., etc., I am finding it necessary to spend more time to clear the exim queue from time to time. I went about 5 days last week without cleaning the queue, and there were over 9,000 messages in the queue (all undeliverable mail so exim kept them in the queue to retry them over and over again... zzzzz)

    Anyway, after that I set all accounts to :fail: , but now, I still need to clean the queue on a regular basis due to filthy spammers.

    Thus, my question is, instead of doing this from within WHM, I would like to run a cron tab to do this. While in SSH, what command would I use to delete the queue just like is performed in WHM?

    Thanks.
     
  2. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18
    exim cheatsheet

    http://bradthemad.org/tech/notes/exim_cheatsheet.php


    I have the following script to clear out boxtrapper messages which are stuck in the exim queue:

    you can modify it as needed to solve your problem:
    #!/bin/sh
    exim -Mrm `grep -lr 'To complete this verification, simply reply' /var/spool/exi
    m/input/ | sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g'` 2> /dev/null
     
  3. jesmarcelo

    jesmarcelo Registered

    Joined:
    Mar 21, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1

    exim -bp | grep \< | awk '{print $3}' | xargs exim -Mrm
     
  4. mambovince

    mambovince Well-Known Member

    Joined:
    Jan 15, 2005
    Messages:
    192
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    London, UK
    I run the following, slightly different:

    PHP:
    exim -bpru|grep frozen|awk {'print $3'}|xargs exim -Mrm
    - Vince
     
  5. bmcpanel

    bmcpanel Well-Known Member

    Joined:
    Jun 1, 2002
    Messages:
    546
    Likes Received:
    0
    Trophy Points:
    16
    Thanks guys. The examples work just fine. I have a cron job setup and this will help me automate one of the boring server tasks for me. Thanks again!
     
    #5 bmcpanel, Jul 6, 2006
    Last edited: Jul 6, 2006
  6. nxds

    nxds Well-Known Member

    Joined:
    Jan 6, 2006
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Alternatively use exiqgrep:

    PHP:
    exiqgrep -zi xargs exim -Mrm
    This is also good for removing failed delivery messages to (likely) non-existent senders:
    PHP:
    exiqgrep --'<>'  xargs exim -Mrm
     
Loading...

Share This Page