* Chris Green <[EMAIL PROTECTED]> [2002-09-26 08:38]: [...] > Or even better does anyone have any sample scripts using mutt as the > 'source' for archiving mail? I've been looking at archmbox but it > doesn't quite fit my requirements and I suspect that using mutt to > actually extract the messages I want to archive may be easier than > bodging archmbox. I particularly want to preserve the directory > hierarchy, i.e. what I want to do ultimately is extract all messages > older than xxx days from my current mail and append them to mailboxes > in an identical archive hierarchy (which will be on a different > machine with no serious disk quota limits).
Procmail is probably the best tool for the job. Just yesterday I wrote the following procmail recipe file for this. It will parse out the year from each message and determine a quarter from the month, then move it to a mailbox of the format 2002-qtr3. MONTH="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)" FIRST_QTR="(Jan|Feb|Mar)" SECOND_QTR="(Apr|May|Jun)" THIRD_QTR="(Jul|Aug|Sep)" FOURTH_QTR="(Oct|Nov|Dec)" :0 : *$ ^Date:.*$FIRST_QTR *$ ^Date:.*$MONTH +\/[0-9]* $MATCH-qtr1 :0 : *$ ^Date:.*$SECOND_QTR *$ ^Date:.*$MONTH +\/[0-9]* $MATCH-qtr2 :0 : *$ ^Date:.*$THIRD_QTR *$ ^Date:.*$MONTH +\/[0-9]* $MATCH-qtr3 :0 : *$ ^Date:.*$FOURTH_QTR *$ ^Date:.*$MONTH +\/[0-9]* $MATCH-qtr4