procmail
[Top] [All Lists]

Re: Recipes based on date and time

1996-10-30 20:00:10
Here is my .datestringrc.  Notice that it is much simpler than your date.rc 
because it tackles a much simpler problem: it deals with a consistent input
syntax (the From_ line), it parses the information we actually want to know,
and it doesn't set up the combination variables that the user might not need:

It is true that date.rc is complex.  I wrote date.rc to solve "once and
for all" most of my date parsing needs, and not necessarily the
received dates of incoming mail. 

For example, I had a customer who wanted to refile many folders of
stored mail according to date-based criteria, none of which had a "From
" line.  So, using the consistent format of the From line was not
possible.  I had to use the "Date:" line, if it existed, and it did
exist in a variety of formats.

So, your "datestringrc" works if there is a "From " line, but is not
as useful for refiling mail which do not have them.

I do agree with you that running a "date" many times, for each piece of
mail is not a good idea.

But, I am also sad that it takes so much programming effort to deal with
date strings and fields in procmail, even if I've been successful and done 
it "once and for all", in "date.rc".   This is just another case of
a need for a macro library in procmail.

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