[Dovecot] 1.2.beta1: expire-tool and 'mail_location' setting

e-frog e-frog at gmx.de
Mon Jun 1 18:43:27 EEST 2009


Timo Sirainen wrote:
> On Mon, 2009-05-18 at 21:23 +0200, e-frog wrote:
>> Timo Sirainen wrote:
>>> On Sun, 2009-02-22 at 12:49 +0100, e-frog wrote:
>>>> Trying 1.2.beta1 with expire plugin currently:
>>>> When I set mail_location = maildir:~/.maildir the expire plugin doesn't delete messages.
>>> Should be fixed in hg now.
>>>
>>>> My guess is that mail_location is not respected by expire-tool for some reason and in second
>>>> case mailbox auto-detection makes it working?
>>> Yes.
>>>
>> Thanks Timo! It works now as long as there is no namespace for the virtual plugin defined:
> 
> http://hg.dovecot.org/dovecot-1.2/rev/6fd725b94504
> http://hg.dovecot.org/dovecot-1.2/rev/531083e6e84a

The above doesn't seem to fix it completely. However after adding module_dir_init(modules) it works:

--- expire-tool.c.old   2009-06-01 17:14:54.000000000 +0200
+++ expire-tool.c       2009-06-01 17:16:50.000000000 +0200
@@ -263,6 +263,8 @@ static void expire_run(bool testrun)
        mail_storage_init();
        mail_storage_register_all();
        mailbox_list_register_all();
+
+       module_dir_init(modules);

        expire_get_global_mail_ids();

> 
> Then put mail_plugins setting outside protocol {}.
> 

It looks like the mail_plugins setting outside protocol has no effect.
Checking the environment of expire-tool as following

/usr/sbin/dovecot --exec-mail ext /opt/bin/expire-tool.sh

expire-tool.sh:
#!/bin/sh
set > /tmp/dovecot-environment
/usr/lib/dovecot/expire-tool $1


dovecot-environment:
...
MAIL_PLUGINS='virtual expire'
MAIL_PLUGIN_DIR='/usr/lib/dovecot/modules/imap'
...

These are the settings from the protocol imap section.

In addition I noticed that dovecot -n also shows the same settings as
for protocol imap for mail_plugins(default). However dovecot.conf
definitely contains mail_plugins = virtual outside the protocol sections.
I would have expected to see mail_plugins(default): virtual then.

mail_plugins(default): virtual expire
mail_plugins(imap): virtual expire
mail_plugins(managesieve):
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve




More information about the dovecot mailing list