procmail
[Top] [All Lists]

Re: archive old mail (formail?)

1997-03-26 15:23:56
On Wed, 26 Mar 1997 16:11:16 -0500 (EST),
Lars Kellogg-Stedman <lars(_at_)bu(_dot_)edu> wrote:
Does anybody have a script, that I assume would use 
formail, that will take a list of files (my pine mailboxes)
and archive messages more than "n" days old or something?
I'd love to find a simple way of doing this.  Unfortunately, there's
precious few programs out there that understand dates.  With close to 30
mailboxes receiving daily log output from over 4 departmental clusters, I
need some way to gracefully expire messages after they reach a certain
age.
Here are two solutions I've come up with:

Nothing revolutionary here, but here are a couple more suggestions, if
nothing else for completeness' sake. 

  * A "date canonizer" was posted to the list about a month ago; this
    is a small C program which takes a date and recasts it into a
    canonical form suitable for furhter processing. I haven't studied
    this program in any detail but there is allegedly not a complete
    1-1 mapping of time zones used and notations used so it can
    probably never be perfect 

  * What exactly do you want to accomplish? For many applications it's
    sufficient to find a From_ line with a given date and ditch
    everything before that From_ line. (You can almost do this
    trivially with sed and GNU date.)

The "backup" example in procmailex(5) would need little modification
to at least eliminate the need for mh in Lars's second suggestion. 

Hope this helps,

/* era */

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

<Prev in Thread] Current Thread [Next in Thread>