[Dovecot] How to set MDNSent flag on a large amount of mails?

Patrick Nagel patrick.nagel at star-group.net
Tue Jun 3 19:33:04 EEST 2008


after having moved a big mail archive to IMAP, I've now got the following
problem: The MUA asks to send an MDN on all those old messages that contain
the 'Disposition-Notification-To' header when opened. I'd like to set the
$MDNSent flag on those (>10000 in a deeply nested directory structure)

After having read http://wiki.dovecot.org/MailboxFormat/Maildir I wrote a
script that changed the filename of mails in all directories that contained
the header, so that the filename contained a 'b' in the last part of the
filename (after the comma), because I found '1 $MDNSent' in
Maildir/dovecot-keywords. I then discovered that there can be a
'dovecot-keywords' file in each directory, and all of those files can have
different flags in different order.

Do I really need to write a script that evaluates each dovecot-keywords
file, figures out which letter corresponds to the flag and rename the files
(per directory) accordingly? Isn't there a more simple way?


STAR Software (Shanghai) Co., Ltd.            http://www.star-group.net/
Phone:    +86 (21) 3462 7688 x 826             Fax:   +86 (21) 3462 7779

PGP key:         https://stshacom1.star-china.net/keys/patrick_nagel.asc
Fingerprint:           E09A D65E 855F B334 E5C3 5386 EF23 20FC E883 A005

More information about the dovecot mailing list