Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Location
    London, UK
    Posts
    285

    Clear messages from queue by subject line - SSH

    Hi,
    Due to spammer activity, I find myself with 20,000 messages in the queue and I'd really like to remove those emails from the queue as it is causing delays to good messages. :-(

    Can you give me the SSH command to remove messages by subject line please?

    I have already used
    exim -bpru|grep frozen|awk {'print $3'}|xargs exim -Mrm
    and
    exiqgrep -i -f '<>' | xargs exim -Mrm
    and
    exim -bpu |awk '/nobody/ {print $3} ' |xargs exim -Mrm

    But there are still 11,000 messages left in the queue.
    The spammer messages have the following subject lines:

    IS THIS TRUE?
    PAYMENT UPDATE
    Online Banking Account Is Locked !
    Online Banking has been locked
    ARE STILL ALIVE /THIS A SAD NEWS ABOUT YOU

    Many thanks,

    - Vince

  2. #2
    Join Date
    Feb 2005
    Location
    Upstate NY
    Posts
    14

    Deleting messages from exim queue by subject

    Quote Originally Posted by hostingvince View Post
    Hi,
    Due to spammer activity, I find myself with 20,000 messages in the queue and I'd really like to remove those emails from the queue as it is causing delays to good messages. :-(

    Can you give me the SSH command to remove messages by subject line please?

    I have already used
    exim -bpru|grep frozen|awk {'print $3'}|xargs exim -Mrm
    and
    exiqgrep -i -f '<>' | xargs exim -Mrm
    and
    exim -bpu |awk '/nobody/ {print $3} ' |xargs exim -Mrm

    But there are still 11,000 messages left in the queue.
    The spammer messages have the following subject lines:

    IS THIS TRUE?
    PAYMENT UPDATE

    - Vince
    Had to solve a similar problem, here it all is. I'd recommend you break the pipe up at first just to confirm what each step is giving you. Run this as root in the /var/spool/exim/input directory -- and just rerun for each subject:

    find . -name "*-H" -exec grep -l "Subject: PAYMENT UPDATE" {} \; | cut -d/ -f3 | sed 's/-H$//' | xargs exim -Mrm
    -----------------------------------------
    John Murtari
    http://www.SoftwareWorkshop.com/

  3. #3
    Join Date
    Mar 2003
    Location
    Jaipur, India
    Posts
    642
    Hi,

    try with these :-
    To print a list of the messages in the queue, enter:
    # exim -bp

    To remove a message from the queue, enter:
    # exim -Mrm {message-id}

    To remove all messages from the queue, enter:
    # exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash

    Alternatively use following clean command:
    # exim -bp | exiqgrep -i | xargs exim -Mrm

    Hope this will work.
    ZNetLive
    Web Hosting for Designers & Developers

  4. #4
    Join Date
    Aug 2011
    Location
    India
    Posts
    288
    The script given by John, should work. You can split it for better control as given below


    cd /var/spool/exim/input

    // collect the mail ids

    find . -name "*-H" -exec grep -l "Subject: PAYMENT UPDATE" {} \; | cut -d/ -f3 | sed 's/-H$//' >> mids.txt


    Remove the mails from the queue

    for i in 'cat mids.txt'
    do
    exim -Mrm $i

    done
    Fred Bruner
    Business Analyst
    SupportSages.com- Bytes of Wisdom @ Work - Where guarantees and promises are made to keep!
    24/7 Support with 15 mins response time & no charge guarantees

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •