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 Mail Queue

Discussion in 'E-mail Discussions' started by compunet2, Jan 4, 2008.

  1. compunet2

    compunet2 Well-Known Member

    Joined:
    Feb 21, 2003
    Messages:
    310
    Likes Received:
    0
    Trophy Points:
    16
    I know from WHM, I can use /scripts2/killeximq, but is there a way to do it in SSH?
     
  2. john_accu

    john_accu Member

    Joined:
    Mar 12, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    1) Login as root via SSH.
    2) Go to /var/spool/exim/ folder.
    3) type rm -Rf input and press Enter key.

    cheers!
     
  3. AnilR

    AnilR Active Member

    Joined:
    Nov 24, 2007
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    You can use the exim binary to delete the mail queue from command line using the command

    # /usr/local/cpanel/whostmgr/bin/whostmgr2 killeximq

    ;)
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    That will break exim. You should not delete the input directory, just its contents. If you do that you should also remove the contents of the msglog subdirectory. Before you do either, you should also stop exim and chkservd.
     
  5. john_accu

    john_accu Member

    Joined:
    Mar 12, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1

    Thanks for the detailed information! :)
     
  6. Scott.Mc

    Scott.Mc Member

    Joined:
    Feb 22, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    You can also use exigrep or even just for loop the exim -bp output.
     
  7. troxalias

    troxalias Well-Known Member

    Joined:
    Nov 21, 2001
    Messages:
    96
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Athens - Greece
    To delete all mails you can issue the command
    exim -bpru | awk {'print $3'} | xargs exim -Mrm

    If you want a script with the ability to delete mails per sender or per receiver please check http://cphelp.gr/kb/?View=entry&EntryID=4
     
  8. jpetersen

    jpetersen Well-Known Member

    Joined:
    Dec 31, 2006
    Messages:
    113
    Likes Received:
    4
    Trophy Points:
    18
    This is the correct way:

    stop chkservd
    stop exim
    /usr/sbin/exiqgrep -i | xargs /usr/sbin/exim -Mrm
    start exim
    start chkservd
     
Loading...

Share This Page