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.

How can i delete part of domain's mail in the Mail Queue ? not delete all !

Discussion in 'E-mail Discussions' started by hkewell, Aug 15, 2007.

  1. hkewell

    hkewell Well-Known Member

    Joined:
    May 17, 2002
    Messages:
    170
    Likes Received:
    0
    Trophy Points:
    0
    I want to delete part of mail in queue which more than one thousand. But i don't want to delete all.

    any idea ?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    -Delete all emails of "from@domain.com" from the mailserver queue:

    exim -bp | grep from@domain.com | awk '{ print $3 }' | grep -v "^$" | xargs exim -Mrm

    -Delete all emails of "to@domain.com" from the mailserver queue:

    exim -bp | grep to@domain.com | awk '{ print $4 }' | grep -v "^$" | xargs exim -Mrm

    -To remove selective emails

    grep user@domain.com /var/log/exim_mainlog | cut -d" " -f3 > list ; for ID in `cat list` ; do exim -Mrm $ID; done
     
Loading...

Share This Page