Deleting all e-mail from a POP server

Discussion in 'Site & Server Administration' started by ajayr, Mar 27, 2006.

  1. #1
    Hi,

    I have a POP account that I do not use. It is currently overflowing with messages. Is there any way using which I can clear the mailbox without having to use an e-mail client to download each mail?

    I have shell access to the server (which is running Linux).

    Ajay.
     
    ajayr, Mar 27, 2006 IP
    Momo likes this.
  2. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #2
    What MTA is it?
     
    RectangleMan, Mar 29, 2006 IP
  3. ajayr

    ajayr Active Member

    Messages:
    322
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #3
    I am not sure, but the server does run sendmail.
     
    ajayr, Mar 29, 2006 IP
  4. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #4
    You should be able to remove the account via ssh (or ftp) for that matter. Simply cd to the desired mail directory. You may want to:

    1. make note of the perms of the file (both chown and chmod), in case you have to recreate it.
    2. after deleting the file (it's technically a text file), send a test message to that account. The file *should* recreate automatically, but if not, recreate the file manually and set perms.
     
    flawebworks, Mar 29, 2006 IP
  5. sacx13

    sacx13 Active Member

    Messages:
    438
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #5
    If you have access at shell is easy. Log as your user (not root or wathever)

    sacx@sacx:~/Desktop$ mail
    Mail version 8.1.2 01/15/2001. Type ? for help.
    "/var/mail/sacx": 20 messages 20 unread
    >U 1 root@localhost.lo Sat Feb 11 06:26 28/1458 Cron <root@sacx> test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
    U 2 root@localhost.lo Sun Feb 12 06:27 22/916 Cron <root@sacx> test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
    ......................
    > d 1-20 <-- delete all messages between 1 and 20
    >q <-- quit

    Regards
    Adrian
     
    sacx13, Mar 29, 2006 IP