At 11:11 2007-08-12 -0700, Dr. K. F. Lee wrote:
Hi,
When I have a question, you guy often reply with a link that contains
discussion around the issue. Is there a way for me to put a few keywords
to search the procmail archieve to get the link?
<http://www.xray.mpe.mpg.de/mailing-lists/procmail/> has a near complete
and searchable archive, but as with searching for anything, you need to try
a few searches, and come up with variant forms of your query, often
starting more broad (3 days is too specific for instance), then revising it.
I want to write a script to just move the email that is older than 3 days
to somewhere else and I guess such simple question must have been asked
before but I just dont know how to find the examples.
Is this an email which is sitting in an already receuved mailbox, or is it
"live" mail which is being delivered, but apparently was held up in the
system (say, due to a chuffed MX host)?
Well, the recipe to direct the message someplace would be the same, but the
process would be dramatically different. For already saved messages, you'd
need to move the mailbox elsewhere, process ALL the messages in it,
re-storing messages which are not too old to a new copy of the same
mailbox, and shunting those which are old. This would be invoked by an
external script.
The basic process involves using the 'date' program to take either the
message date, or the date in the From_ header, to establish message
age. One can generally trust the From_ header date to be correct - it's
inserted by your mailhost, while the Date: header itself is generated by
the sending MUA or MTA, and can vary wildly, from invalid format (spam), to
incorrect times because either the sender can't keep their computer
configured properly or spam, which sometimes (for reasons unknown to me)
sets dates on messages to be days in the past or future. 'datestamp' would
be a good keyword to use to try to find discussions of this.
There's a technique covered here probably 2+ years ago for parsing the
dates in both the From_ and Date: headers and comparing them, to isolate
messages which are inconsistent. That could easily be adopted to your
needs, at least as far as the procmail logic part goes.
One such example:
<http://www.xray.mpe.mpg.de/mailing-lists/procmail/2003-05/msg00153.html>
(note that in various examples you're likely to find, the Date: and From_
headers are compared - not Date: and the current system date -- so
reprocessed messages aren't flagged as spam if they are re-run through a
filter at a later date -- you would probably use the current system date
and the From_ date to gauge message age)
---
Sean B. Straw / Professional Software Engineering
Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
Please DO NOT carbon me on list replies. I'll get my copy from the list.
____________________________________________________________
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