Dynamic autoexpunge for IMAP folders
Dear all,
is there a way to allow users to set up something like autoexpunge on an individual IMAP folder basis?
The idea I implemented does not seem to work, namely returning
namespace/inbox/mailbox/Bla/autoexpunge=6h
from a userdb, which results in
Debug: Unknown userdb setting: plugin/namespace/inbox/mailbox/Bla/autoexpunge=6h
From older questions on the mailing list I gather that the mailbox Bla needs to be set up in the config before I can override its fields. If there is a way around this, I would gladly use this.
Another solution that comes to mind would be to use a table-driven cron job, but I would prefer the cleanup to be triggered at delivering and/or moving mail.
Best regards, Thorsten
- Thorsten Hater thorsten.hater@gmail.com 2017.01.17 09:40:
namespace/inbox/mailbox/Bla/autoexpunge=6h
from a userdb, which results in
Debug: Unknown userdb setting: plugin/namespace/inbox/mailbox/Bla/autoexpunge=6h
userdb_namespace/inbox/mailbox/Bla/autoexpunge=6h
Regards Thomas
Unfortunately, this yields the same problem
Debug: Unknown userdb setting: plugin/userdb_namespace/inbox/mailbox/Bla/autoexpunge=6h
Thorsten
On Tue, Jan 17, 2017 at 10:16 AM, Thomas Leuxner tlx@leuxner.net wrote:
- Thorsten Hater thorsten.hater@gmail.com 2017.01.17 09:40:
namespace/inbox/mailbox/Bla/autoexpunge=6h
from a userdb, which results in
Debug: Unknown userdb setting: plugin/namespace/inbox/mailbox/Bla/autoexpunge=6h
userdb_namespace/inbox/mailbox/Bla/autoexpunge=6h
Regards Thomas
- Thorsten Hater thorsten.hater@gmail.com 2017.01.17 10:57:
Unfortunately, this yields the same problem
Debug: Unknown userdb setting: plugin/userdb_namespace/inbox/mailbox/Bla/autoexpunge=6h
userdb_namespace/inbox/mailbox/Bla/autoexpunge=6h
'plugin' is not part of the userdb override. It is literally as above.
I know, but it is not present in the string returned by the userdb, which is set up for testing
userdb { driver = static args = namespace/inbox/mailbox/Bla/autoexpunge=6h }
On Tue, Jan 17, 2017 at 11:03 AM, Thomas Leuxner tlx@leuxner.net wrote:
- Thorsten Hater thorsten.hater@gmail.com 2017.01.17 10:57:
Unfortunately, this yields the same problem
Debug: Unknown userdb setting: plugin/userdb_namespace/inbox/mailbox/Bla/autoexpunge=6h
userdb_namespace/inbox/mailbox/Bla/autoexpunge=6h
'plugin' is not part of the userdb override. It is literally as above.
- Thorsten Hater thorsten.hater@gmail.com 2017.01.17 12:04:
userdb { driver = static args = namespace/inbox/mailbox/Bla/autoexpunge=6h }
I'm almost sure that 'driver = static' contradicts the concept of userdb overrides:
http://wiki.dovecot.org/UserDatabase/ExtraFields
If you can't go with 'passwd-file' style settings, you may able to achieve this globaly with:
protocol imap { namespace inbox { location = mailbox Blah { autoexpunge = 6h } prefix = } }
In any case this is then a global setting rather than one being returned on a per-user basis.
So, returning from the LDAP userdb does not change situation. As I said, I would to set folder names dynamicaly, without setting up a mailbox in advance. Here the problem is discussed
http://www.dovecot.org/list/dovecot/2013-August/092023.html
but no solution is found apart from defining the namespace in the static config, see here
http://www.dovecot.org/list/dovecot/2013-August/092053.html
As I do not know what folders the user might to configure for autoexpunge, I cannot put the folders into the config.
Thorsten
On Tue, Jan 17, 2017 at 12:14 PM, Thomas Leuxner tlx@leuxner.net wrote:
- Thorsten Hater thorsten.hater@gmail.com 2017.01.17 12:04:
userdb { driver = static args = namespace/inbox/mailbox/Bla/autoexpunge=6h }
I'm almost sure that 'driver = static' contradicts the concept of userdb overrides:
http://wiki.dovecot.org/UserDatabase/ExtraFields
If you can't go with 'passwd-file' style settings, you may able to achieve this globaly with:
protocol imap { namespace inbox { location = mailbox Blah { autoexpunge = 6h } prefix = } }
In any case this is then a global setting rather than one being returned on a per-user basis.
On 17 Jan 2017, at 13.36, Thorsten Hater thorsten.hater@gmail.com wrote:
So, returning from the LDAP userdb does not change situation. As I said, I would to set folder names dynamicaly, without setting up a mailbox in advance. Here the problem is discussed
http://www.dovecot.org/list/dovecot/2013-August/092023.html
but no solution is found apart from defining the namespace in the static config, see here
http://www.dovecot.org/list/dovecot/2013-August/092053.html
As I do not know what folders the user might to configure for autoexpunge, I cannot put the folders into the config.
You need to list what mailboxes exist:
namespace/inbox/mailbox=foo bar namespace/inbox/mailbox/foo/autoexpunge=6h namespace/inbox/mailbox/bar/autoexpunge=6h
If there are spaces, they need escaping. I think for spaces it was:
namespace/inbox/mailbox=Sent\_Messages
Thorsten
On Tue, Jan 17, 2017 at 12:14 PM, Thomas Leuxner tlx@leuxner.net wrote:
- Thorsten Hater thorsten.hater@gmail.com 2017.01.17 12:04:
userdb { driver = static args = namespace/inbox/mailbox/Bla/autoexpunge=6h }
I'm almost sure that 'driver = static' contradicts the concept of userdb overrides:
http://wiki.dovecot.org/UserDatabase/ExtraFields
If you can't go with 'passwd-file' style settings, you may able to achieve this globaly with:
protocol imap { namespace inbox { location = mailbox Blah { autoexpunge = 6h } prefix = } }
In any case this is then a global setting rather than one being returned on a per-user basis.
Excellent, that works for me. Actually, I add one more setting to be on the safe side regarding IMAP capitalisation rules (or non-rules).
namespace/inbox/mailbox=bla namespace/inbox/mailbox/bla/name=Bla namespace/inbox/mailbox/bla/autoexpunge=6h
Thanks a lot.
On Wed, Jan 18, 2017 at 2:01 AM, Timo Sirainen tss@iki.fi wrote:
On 17 Jan 2017, at 13.36, Thorsten Hater thorsten.hater@gmail.com wrote:
So, returning from the LDAP userdb does not change situation. As I said, I would to set folder names dynamicaly, without setting up a mailbox in advance. Here the problem is discussed
http://www.dovecot.org/list/dovecot/2013-August/092023.html
but no solution is found apart from defining the namespace in the static config, see here
http://www.dovecot.org/list/dovecot/2013-August/092053.html
As I do not know what folders the user might to configure for autoexpunge, I cannot put the folders into the config.
You need to list what mailboxes exist:
namespace/inbox/mailbox=foo bar namespace/inbox/mailbox/foo/autoexpunge=6h namespace/inbox/mailbox/bar/autoexpunge=6h
If there are spaces, they need escaping. I think for spaces it was:
namespace/inbox/mailbox=Sent\_Messages
Thorsten
On Tue, Jan 17, 2017 at 12:14 PM, Thomas Leuxner tlx@leuxner.net
wrote:
- Thorsten Hater thorsten.hater@gmail.com 2017.01.17 12:04:
userdb { driver = static args = namespace/inbox/mailbox/Bla/autoexpunge=6h }
I'm almost sure that 'driver = static' contradicts the concept of userdb overrides:
http://wiki.dovecot.org/UserDatabase/ExtraFields
If you can't go with 'passwd-file' style settings, you may able to
achieve
this globaly with:
protocol imap { namespace inbox { location = mailbox Blah { autoexpunge = 6h } prefix = } }
In any case this is then a global setting rather than one being returned on a per-user basis.
participants (3)
-
Thomas Leuxner
-
Thorsten Hater
-
Timo Sirainen