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.

thousands of e-mail in Queue

Discussion in 'E-mail Discussions' started by dxer, May 19, 2004.

  1. dxer

    dxer Well-Known Member

    Joined:
    Sep 9, 2002
    Messages:
    295
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Europe
    I need help with Mail in Queue. Since several days I started to receive thousands of junk e-mail waitting in queue. Is this related to Exim security alert discovered several days ago ?

    i did not upgrade cPanel as iam waiting for stable release but if this is the problem I will have to upgrade to latest current or something like that or just Exim upgrade.

    Please advise
     
  2. enochii

    enochii Registered

    Joined:
    Feb 17, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    ditto - yesterday I twice deleted ques of over 1000 emails. Just deleted over 200 and checked literally 5 miinutes later and there are 29.

    Any help for the not so advanced user???

    :confused:
     
  3. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    There are a few ways but I did this script to help me.
    Code:
    #!/bin/sh
    # cleanque - Shell to clean out the mail queue with matches we find
    cd /tmp
    
    # You could create a file on things to look for then change the for loop
    for NAME in `cat spamlist`      # list of NAMES, one on each line in file
    
    # or if there a just a few use this
    #for NAME in shellpost.com [email]admin@internet.com[/email]
    do
    
    # Now lets clean the que out for each match we find
    
            cd /tmp
    #       exim -bp | grep -1 $NAME        # uncomment for debug
            exim -bp | grep -1 $NAME > spamlist1
    #       awk '{print $3}' spamlist1 | grep -v "^$"       # uncomment for debug
            awk '{print $3}' spamlist1 | grep -v "^$" > spamlist2
            cd /var/spool/exim/input
            for i in `cat /tmp/spamlist2` ; do rm -f $i*; done;
            cd /tmp
    #       exim -bp | grep -1 $NAME        # uncomment for debug
    done
    
    # Clean up our temporary files
    #rm /tmp/spamlist*
    
    #
    # End
    #
    
    Now I use the spamlist file since my list is growing. You will need to take a look at your que "exim -bq" to see what is going on. You can build your list from this. Most cases there is something similar and you can use it in the NAME for the script.
     
  4. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    maybe something like this also.
    Code:
    # Create a list of queued files with other issues like "potentially executable ttt
    achments" or anything else you want
    cd /var/spool/exim/input
    grep "cpl" * | awk -F":" '{print $1}' > /tmp/morespam
    cd /var spool/exim/input
    for i in `cat /tmp/morespam` ; do rm -f /var/spool/exim/$i*; done;
    rm /tmp/morespam
    
    You could have the grep look for just about anything like "Possible Spam" or others.
    Add
    Code:
    grep "Possible Spam" * >> /tmp/morespam
    
    below
    Code:
    grep "cpl" * | awk -F":" '{print $1}' > /tmp/morespam
    

    THIS NEEDS TESTING!!!!
     
    #4 asmithjr, May 19, 2004
    Last edited: May 19, 2004
  5. rusko

    rusko Member

    Joined:
    Nov 20, 2002
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
Loading...

Share This Page