Timo Sirainen
2010-Apr-13 18:20 UTC
[Dovecot] Expire plugin / expire-tool redesign for doveadm
Expire plugin / expire-tool seems annoyingly inflexible currently, so I was thinking about a more generic redesign: The expire plugin keeps track of the oldest message in configured mailboxes. Its only configuration is the list of tracked mailboxes. There's no configuration like what the expire timeouts are or anything. There will be a new doveadm command: doveadm expunge [-u user | -A] <mailbox> <search query> So when you want to expunge all mails from Trash older than 1 week for all users, you say: doveadm expunge -A Trash savedbefore 1w This command works even without expire plugin. To optimize it to avoid looking into all users' Trash mailbox, there's a new expire doveadm plugin, which can use the expire dict to filter out users who don't have anything to expunge. This also supports another feature that the plugin can optimize: doveadm move -A INBOX Archive/2009/INBOX since 2009-01-01 before 2010-01-01 And since people have had problems waiting for expire dict to fill, there could be also a new parameter that does the filling immediately. TODO: - dbox altmove feature will be removed from expire plugin. it may need another plugin, or some other way to configure expire plugin for it. it's anyway a special case. - When using multiple mailboxes it would be more optimal to handle all mailboxes for a user at once, rather than using separate doveadm commands. Maybe the command syntax needs some more thinking to support this. Different mailboxes could have different rules though.. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20100413/f5be64d8/attachment-0002.bin>
Steffen Kaiser
2010-Apr-14 08:04 UTC
[Dovecot] Expire plugin / expire-tool redesign for doveadm
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, 13 Apr 2010, Timo Sirainen wrote:> The expire plugin keeps track of the oldest message in configured > mailboxes. Its only configuration is the list of tracked mailboxes. > There's no configuration like what the expire timeouts are or anything.My first idea, that hit me after reading through the whole post, was to keep track of all mailboxes of all users and issue the commands later. The plugin saves just one value per physical mailbox, when a) the first message arrives an empty mailbox or messages are expunged? Or each time a message is received. What would be the impact of monitoring all mailboxes?> There will be a new doveadm command: > > doveadm expunge [-u user | -A] <mailbox> <search query>What about shared mailboxes and namespaces? Can "<mailbox>" be a phyiscal path rather than a IMAP mailbox name?> So when you want to expunge all mails from Trash older than 1 week for > all users, you say: > > doveadm expunge -A Trash savedbefore 1w> TODO: > > - When using multiple mailboxes it would be more optimal to handle all > mailboxes for a user at once, rather than using separate doveadm > commands. Maybe the command syntax needs some more thinking to support > this. Different mailboxes could have different rules though..Hmm, does doveadm support to read commands from stdin / file? If I imagine such scenario with some hundreds of users having configured expire for some folders, that leads to plenty of process creations etc.pp. doveadm <<EOT expunge -A Trash savedbefore 1w expunge -u user1 INBOX savedbefore 1y expunge -u user2 INBOX savedbefore 1m EOT Regards, - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQEVAwUBS8V2/b+Vh58GPL/cAQJloggAwxk85Y3pCeu6u6timuP25JJ1tRy/mlfr L2sgMooKtQOjz5VJZeLQnQEwDfbFItdRMMbwSg60R740h+yIVhNiJ+sQZ8FdUohj hlUpvMJzdY2XG1R3/dBqEhhHx2YXYfxszyPykvjPOXFz7v/TXqvGJUHdZG13uqRL /qVuhlstR/DBot9xlcqDWiJ/v2hiE53BQxfMn1Umfm05le8C/i9ELHCHC2NKIo6a zCURknf0ORwxoL8E2whRVpUXUCeaJHjDYcKTnGtAsZPlpFRylMiaGN/cDSTrqqpw kMpUtQ8cQbdgkaLgvpRhwxNZm5OjUaa6LyEsTSBTEHTSLa1SM6GSPw==Yfvd -----END PGP SIGNATURE-----