-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Leonidas Safran wrote:
> I even think it might not be a courier specific command, but more an
> IMAP standard.. whatever... how do I "delete" all e-mails of an
> e-mail account, on system side (not with an e-mail client)? I don't
> want to delete the account, only all e-mails.
Courier uses "maildirs" for storing messages. A maildir is a directory
(usually called "Maildir" if you are using courier as your MTA as well)
which has three directories in it: 'new', 'cur', and 'tmp'. All the
mail in an account's INBOX will be in the 'new' or 'cur' directories,
one file per message.
So to delete all the messages in an account's INBOX, you delete all the
files in the 'new' and 'cur' directories within that account's maildir.
Don't delete the 'new' and 'cur' directories themselves or you'll mess
up the account. Just delete the files inside them.
So assuming you want to delete all the mail in the maildir
/home/leonidas/Maildir
you would run from the command line
rm -f /home/leonidas/Maildir/{new,cur}/*
and all the mail in the INBOX is gone.
If you want to delete ALL the mail in all the directories within this
account, then you need to delete all the files in all the 'new' and
'cur' directories within that maildir. So you would run
rm -f /home/leonidas/Maildir/{new,cur}/*
rm -f /home/leonidas/Maildir/.*/{new,cur}/*
The first line gets rid of the INBOX, the next gets rid of any mail in
all the folders.
If you just want to get rid of mail in a particular folder (not the
INBOX) then you find that folder on the disk by looking for it inside
the main maildir, where the directory name on the disk is the same as
the folder in the account, except it will begin with a period (.). So
if you are looking for a folder called "Sent" in that account, then all
the mail will be in the 'new' and 'cur' directories of the directory
/home/leonidas/Maildir/.Sent
so
rm -f /home/leonidas/Maildir/.Sent/{new,cur}/*
will empty the "Sent" folder. Folder within folders follow the same
structure except that periods separate the levels. So if your mail
account has a "Sent" folder, with a "2005" folder inside that, with a
"June" folder inside that, on the disk it will be located in the directory
/home/leonidas/Maildir/.Sent.2004.June
Wheew! That's probably more information that you needed. :-) But it
ought to let you delete the mail in any folder that you want.
HTH
Jeff Jansen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGouzfGfIHDMaiC9cRAlNdAKCbgbUvAleW/lAtHlBtiNrodZu8XACcD8Ul
Jx2CdJllQIP0D+SxO1RHRyw=
=AUyT
-----END PGP SIGNATURE-----
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users