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 emails from shell

Discussion in 'E-mail Discussions' started by Valuehosted, Jun 26, 2004.

  1. Valuehosted

    Valuehosted Well-Known Member

    Joined:
    Dec 12, 2002
    Messages:
    124
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Sweden
    I have a couple of users with previous default emails to useraccount, since then changed but I need to delete the emails in the email accounts manually from shell.

    I know this is possible from shell but I forget how to; anyone?

    Thanks,

    --Tone
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    If you simply want to remove all the emails from their inbox, then you can:

    cd /home/account/mail/domain.com/username/
    or
    cd /home/account/mail/
    cat /dev/null > inbox

    If you want to delete individual mails (which you probably don't) then you can do so with:

    cd /home/account/mail/domain.com/username/
    or
    cd /home/account/mail/
    mail -f inbox

    which puts you into mail (? for help).
     
  3. Valuehosted

    Valuehosted Well-Known Member

    Joined:
    Dec 12, 2002
    Messages:
    124
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Sweden
    Jonathan,

    awesome - that did it - THANK YOU!

    --Tone
     
Loading...

Share This Page