procmail
[Top] [All Lists]

Re: Maildir and "Date Received"

2009-03-01 02:56:34
Me again...

Am 2009-02-28 14:08:15, schrieb LuKreme:
It looks like Maildir (or at least Courier) gets its mail received time 
stamp from the time on the file itself.  For most things this doesn't 
matter, even with my wholesale moving of messages, but for at least one 
user it really does matter.  So, before I move all their mbox-based mail 
to Maildirs, how do I preserve the received time stamp that will show up 
in their MUA?
------------------------ END OF REPLIED MESSAGE ------------------------

If you filter the message with procmail, you can use TRAP and  a  script
which:

1)  use fomail to get the Date: (or the most recent Received: header)
2)  date --date="${RECV_TIME_RFC}" +%s
    will give you the UNIX time stamp
3)  check, whether in the folder is a file which match

        ${FOLDER}/${RECV_TIME_UNIX}.??*

    where ?? is a number between 00 and 99 and generate a filename which
    does not exist like 1234567890(_dot_)00(_at_)${FQDN_LOCAL}
4)  rename the original file in the mailfolder to the new filename
5)  touch --date="${RECV_TIME_RFC}" ${NEWFILE}

that it is.

Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
<http://www.tamay-dogan.net/>               <http://www.can4linux.org/>
Michelle Konzack   Apt. 917                  ICQ #328449886
+49/177/9351947    50, rue de Soultz         MSN LinuxMichi
+33/6/61925193     67100 Strasbourg/France   IRC #Debian (irc.icq.com)

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