[Dovecot] preserving \Recent when moving messages
Is there any way to preserve \Recent, or am I out of luck?
Some people have reported that my script which shuffles around expired or oversized mail also causes their clients to report it as already read. I guess those clients check \Recent instead of \Seen when they download. I wish I knew which clients.
With Mail::IMAPClient I tried using move(), copy(), and migrate() but the result is the same-- once it looks at the source message, \Recent is gone. (I tried patching it where it greps out the \Recent flag before appending the messages, but that causes a silent error.)
Directly appending to the destination folder does not help either, since I would lose any flags set by the user, and if I tried to preserve those, then I would lose the \Recent flag when I read through the destination folder to figure out which messages were which.
RFC5301 says \Recent can never be set... but does its prohibition include the case of migrating mail, where the intent is to retain them intact? It would be nice if Dovecot offered a migration feature which would move a message from folder to folder without unsetting \Recent.
Mark
On Fri, 2011-02-11 at 18:27 -0800, Mark Hedges wrote:
With Mail::IMAPClient I tried using move(), copy(), and migrate() but the result is the same-- once it looks at the source message, \Recent is gone.
It's not about looking or touching the message. \Recent flags are gone when mailbox is SELECTed. If you want to preserve \Recent flag, you need to EXAMINE a mailbox instead.
RFC5301 says \Recent can never be set... but does its prohibition include the case of migrating mail, where the intent is to retain them intact? It would be nice if Dovecot offered a migration feature which would move a message from folder to folder without unsetting \Recent.
Copying a message always sets the destination mail as \Recent, regardless of whether the original one was.
participants (2)
-
Mark Hedges
-
Timo Sirainen