procmail
[Top] [All Lists]

Re: Robust date code (year extraction)

2004-07-28 20:14:46
* Dallman Ross <dman(_at_)nomotek(_dot_)com> [2004-07-28 15:39]:

Well, that's kind of screwy, frankly, and misapprehends some of the
implicit value of the approach I initially suggested to you.

I don't get what you're saying here.  I believe my version will always
have the exact same result as yours.  I felt that for simply
extracting the date, I did not want to have three or four seperate
recipes, so I encapsulated them into a single recipe.

While this style probably comes at the cost of efficiency,
spamassassin is so costly in comparison that I don't think I can write
any procmail code that will make a significant difference on the
overall processing time (that is, unless I reduce the frequency of
spamassassin executions).

I think ultimately the most readable code for doing Date: extractions
is to use GNU date, which is likely what I will switch to in the end.

It might be better all around to take the year from the top-most
Received header -- less likely to be corrrupted and less likely to
be wrong.

Yes, it's all about grabbing the best timestamp possible.  I just had
some (probably unusual) cases where Date: offered the best timestamp
(in fact, the only timestamp), but I'm all for grabbing server
generated dates whenever practical.  And I think in my case the top
Received timestamp will always match what's on the From_ line, so I
might as well just look at the From_ timestamp.

It seems my server may be already doing the work of replacing the
From_ timestamp, so I might as well take advantage of it.  For those
not as fortunate, someone posted a script recently that will rebuild
the From_ timestamp based on the Received timestamp.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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