[Dovecot] Marking messages read / retaining date with Sieve

Ben Morrow ben at morrow.me.uk
Thu Jan 31 01:56:25 EET 2013

At  1PM -0500 on 30/01/13 you (Bret Martin) wrote:
> I'm trying to mark several hundred thousand messages as read as they
> are delivered via dovecot-lda(1). (I'm importing some mail from
> another format for migration purposes.)
> I've been able to do this with Sieve, but it has the side effect that
> the messages' received and saved dates are set to the current date,
> and Apple Mail (at least) uses one of these to display the message
> date. Without the Sieve filter in place, the dates are retained based
> on the From_ line as I would like.
> Does anyone know of any way I can either
> - retain the date when delivering using Sieve?
> - systematically mark a specific set of messages as read *after*
> delivery instead, perhaps with doveadm(1)? (even marking *everything*
> read would work in this particular case. I couldn't find any way to
> set flags with doveadm)

I would do this by scripting IMAP access. Perl's Mail::IMAPClient has
explicit support for running dovecot/imap in preauth mode, so you don't
even have to authenticate. Of course, you need a Dovecot user account
with access to all the relevant messages.


More information about the dovecot mailing list