Re: [Dovecot] Expire plugin / expire-tool redesign for doveadm

2010-04-14 Thread Timo Sirainen
On 14.4.2010, at 11.04, Steffen Kaiser wrote:

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

Looks like the current code does a dict lookup every time messages are saved. I 
guess this is mainly to fix the situation when expire plugin is enabled after 
messages already exist in mailbox. But this check could be moved to doveadm I 
think.. So the dict would only be updated when:

1) message arrives on empty mailbox
2) first message is expunged

But I don't think it's useful to do this for all mailboxes. Even if it doesn't 
impact normal performance, it wastes disk space on the database for no reason. 
But expire plugin already supports wildcards, so just telling it to monitor "*" 
mailboxes would get what you want.

>> There will be a new doveadm command:
>> 
>> doveadm expunge [-u user | -A]  
> 
> What about shared mailboxes and namespaces? Can "" be a phyiscal 
> path rather than a IMAP mailbox name?

No. By shared mailboxes I guess you mean public (i.e. not another user's 
mailboxes)? You can expunge them using some user that has rights to do that, 
and using e.g. public/blah as the mailbox name.

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

I was actually thinking about that myself today too.

> 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 < expunge -A Trash savedbefore 1w
> expunge -u user1 INBOX savedbefore 1y
> expunge -u user2 INBOX savedbefore 1m
> EOT

I don't think the process creation is much of an issue. But something like this 
could work:

doveadm expunge -A <

Re: [Dovecot] Expire plugin / expire-tool redesign for doveadm

2010-04-14 Thread Steffen Kaiser

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


What about shared mailboxes and namespaces? Can "" 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 <- -- 
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-


[Dovecot] Expire plugin / expire-tool redesign for doveadm

2010-04-13 Thread Timo Sirainen
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]  

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


signature.asc
Description: This is a digitally signed message part