Kfir Lavi <[EMAIL PROTECTED]> writes:

> Hi,
> how do i filter an mbox file to delete all messeges that are older then a 
> month ?

Google:

http://www.argon.org/~roderick/mbox-purge

I have never used it, so I cannot recommend it. A couple of other
ideas to consider:

Write a script (e.g. in awk or perl - check if mbox-purge or
http://zwitterion.org/software/mbox-filter/mbox-filter is of any help,
I never looked at it) that will do it. IIRC the individual messages in
mbox are delimited with "^From " (with a space after "From") regular
expression. Use that as record separator, match each record on the
date, do whatever is necessary.

Alternatively, use a mailreader that can grok the format and delete
old messages. Gnus should be able to do it, others will probably work,
too. All sane MUAs will read mbox format, which is used in the normal
mail spools. E.g. as far as I understand KMail can move its default
maildir to mbox, and then you can set expiration as you wish and the
old messages will be deleted when you exit KMail. Check the
documentation of your favourite MUA.

Pipe the file to "formail -s" and then to some other program (such as
procmail) that will filter as appropriate. You'll have to write the
rules.

-- 
Oleg Goldshmidt | [EMAIL PROTECTED]

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to