procmail
[Top] [All Lists]

Re: Maildir and "Date Received"

2009-03-01 23:18:01
At 03:57 2009-03-02 +0100, Michelle Konzack wrote:
Am 2009-03-01 11:46:06, schrieb LuKreme:
>> 1)  use fomail to get the Date: (or the most recent Received: header)
>> 2)  date --date="${RECV_TIME_RFC}" +%s
>
> This seems trickier than I would have thought.  even with a formail -x
> Date: the resulting datestamp is not really usable by date as it is. Or
> do you have a newer/better date command? Extracting from Received I can
> do, I even have a procmail 'fix date' that does just that, but that
> option is slow.

What of the From_ line? or is this not present in the maildir-stored messages? That date would have been set by the local host on reception of the message, and will be a predictable format (and DEFINATLEY more reliable than the Date: header). It should be nominally different from the datestamp in the topmost Received: header, but will be a lot easier to extract.

There is only one option here, use TRAP and the and do a

    TIME=`date +%s.%N`
    formail -I "X-Local-Received-Time: ${TIME}"

this mean, the serial UNIX time with Nanoseconds and stick them into the
header of the message.  Then you will have forever  the  right  received
time.

Or rather, the time procmail processed the message.

---
 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

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