[TriLUG] mbox cleanup

Jon Carnes jonc at nc.rr.com
Mon Dec 4 17:06:31 EST 2006


Many years ago when I used to do such things, I simply grepped through
the mailbox for the line number I wanted (ie grep for the receive date
on an email header) and then "head" the file using that line number,
grep for the last line number with ^From:, subtract one, and head the
file out again with this as my number of lines - saving this one as the
new Mailbox.

No worries.

Jon

On Mon, 2006-12-04 at 16:12, Brian Henning wrote:
> Hi Gang,
>    What's a quick and easy command-line (i.e. cron-able) tool to take an 
> mbox file and delete messages received prior to a given date?
> 
> The idea is to clean out our two spam-catching mailboxes so that they 
> only hold, say, the past two months' worth of activity.
> 
> Thanks!
> ~Brian
> 
> -- 
> ----------------
> Brian A. Henning
> strutmasters.com
> 336.597.2397x238
> ----------------




More information about the TriLUG mailing list