[Dovecot] Dovecot Expire doesn't work
Hello,
I'm using dovecot and I want to use the "expire" plugin. However, it doesn't work, i.e. mails do not get deleted.
I ran /usr/sbin/dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool --test
and besides printing
Info: stef/Trash: no messages left Info: stef/Spam: no messages left
it doesn't do anything (especially not deleting e-mails). Obviously, in stef/Trash and stef/Spam, there are e-mails waiting to be deleted.
I'm using dbox as mail storage; and use dbox:/var/mail/%u as mail_location in dovecot.conf. Furthermore, I'm running 1.1.16 on a gentoo PPC system.
This is the output from dovecot -n
1.1.16: /etc/dovecot/dovecot.conf
OS: Linux 2.6.29-gentoo-r2 ppc Gentoo Base System release 1.12.11.1 xfs
listen: *, [::] ssl_cert_file: /etc/ssl/dovecot/server.pem ssl_key_file: /etc/ssl/dovecot/server.key login_dir: /var/run/dovecot/login login_executable: /usr/libexec/dovecot/imap-login verbose_proctitle: yes mail_privileged_group: mail mail_location: dbox:/var/mail/%u mail_plugins: expire auth default: verbose: yes debug: yes passdb: driver: pam args: * userdb: driver: passwd socket: type: listen master: path: /var/run/dovecot/auth-master mode: 384 plugin: quota: fs:Disk Quota expire: Trash 7 Spam 30 expire_dict: proxy::expire dict: expire: db:/var/lib/dovecot/expire.db
A strace on /usr/sbin/dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool --test
shows the following output:
mkdir("/var/mail/root", 0770) = -1 EEXIST (File exists) stat64("/var/mail/root/Trash/dbox-Mails", 0xbfda2708) = -1 ENOENT (No such file or directory) write(2, "Info: stef/Trash: no messages lef"..., 35Info: stef/Trash: no messages left ) = 35
which explains why nothing happens (stat64("/var/mail/root/Trash/dbox-Mails", which is empty, it should not even exist, but it passes by a mkdir), but why does it want to check /var/mail/root and not /var/mail/%u (i.e. why no stat64(/var/mail/stef/Trash/dbox-Mails))?
Thanks for your help and kind regards,
-- Stef Simoens
On 6/10/2009, Stef Simoens (stef.simoens@scarlet.be) wrote:
it doesn't do anything (especially not deleting e-mails). Obviously, in stef/Trash and stef/Spam, there are e-mails waiting to be deleted.
It doesn't go by the email date, it goes by the date/time the email was moved into that folder.
In other words, it won't effect emails that were *already* *in* the folder.
Personally, I'd love to see the tool have an option to go by the email date/time instead of when it was moved into the folder...
--
Best regards,
Charles
On 6/11/2009 6:37 PM, Timo Sirainen wrote:
!? This isn't what you said when this was discussed earlier earlier:
Was expire plugin enabled then? If it wasn't, it didn't add them to its database so it doesn't know about them.
... has this changed? Or am I seriosuly misunderstanding what you said? Or... you said 'the mailbox'... does this apply only to mbox files, or to maildirs too? Thanks for the clarification Timo... -- Best regards, Charles
On Jun 12, 2009, at 7:09 AM, Charles Marcus wrote:
I thought I said it several times i several different ways and added a sentence about it to wiki too.. Expire plugin doesn't track each message individually. It only keeps a track of records: <mailbox name> <next timestamp when to look into this mailbox> When the timestamp is reached, it opens the mailbox and expunges all the messages that have old enough save-date.
I'm not sure what above you think contradicts anything I said..
Or am I seriosuly misunderstanding what you said?
Possibly :)
Or... you said 'the mailbox'... does this apply only to mbox files, or to maildirs too?
Expire plugin works the same way with both.
On 6/12/2009, Timo Sirainen (tss@iki.fi) wrote:
Was expire plugin enabled then? If it wasn't, it didn't add them to its database so it doesn't know about them.
... has this changed?
I'm not sure what above you think contradicts anything I said..
It doesn't, I'm just dense... ;) Thx... And incidentally, I don't see how you can be so patient... my hat's off to you... :) -- Best regards, Charles
Hello,
I know how the expire plugin (should) work. I am actually happy that the expire-plugin works as is is defined.
However, the plugin does not work.
- the folder /var/mail/root is created (empty) for no reason (root mails should be forwarded to me, stef)
- the mails in /var/mail/stef/Spam and/or /var/mail/stef/Trash are not expunged after the determined time
As written in my original mail, I did a strace
. In the strace, I see
that expire-tool 'reads' /var/mail/root and 'reports' that
/var/mail/stef has no e-mails.
So, I see two options:
- I made a configuration error (but I don't see it, and I did some serious looking via google and on the wiki, but maybe it's so obvious I didn't pay attention)
- there is a bug in expire-tool
I wrote this e-mail because I suspect the latter [but please inform me if it's the first]
Thanks for your consideration
Stef
Scott Silva schreef:
On Thu, 2009-06-11 at 02:43 +0200, Stef Simoens wrote:
mail_location: dbox:/var/mail/%u
This doesn't work with expire-tool, because the way
A strace on
/usr/sbin/dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool --test
works is that dovecot binary first reads dovecot.conf and expands all %u to root. Then it executes expire-tool, which no longer sees %u at all there. The only way to get this working is to have userdb return the path. So:
a) mail_location = dbox:~/ and have userdb return home.
b) Have userdb return mail=dbox:/var/mail/<username>
userdb: driver: passwd
You should be able to do either of those with something like:
userdb passwd { args = mail=dbox:/var/mail/%u }
v2.0 fixes this problem properly.
Stef Simoens schreef:
I tried both mail_location = dbox:~/
userdb passwd { args = mail=dbox:/var/mail/%u }
and
mail_location = dbox:~/
userdb passwd { args = home=/var/mail/%u mail=dbox:/var/mail/%u }
... but both seem to prefer delivering my e-mail in ~
-- Stef Simoens stef.simoens@numericable.be +32 486 577 963 http://users.numericable.be/stef
Timo Sirainen schreef:
Set auth_debug=yes and mail_debug=yes, what does it log?
Jun 22 22:48:09 robin dovecot: auth(default): master out: USER^I1^Istef^Ihome=/var/mail/stef^Imail=dbox:/var/mail/stef^Isystem_user=stef^Iuid=1000^Igid=1000 Jun 22 22:48:09 robin dovecot: IMAP(stef): Loading modules from directory: /usr/lib/dovecot/imap Jun 22 22:48:09 robin dovecot: IMAP(stef): Module loaded: /usr/lib/dovecot/imap/lib20_expire_plugin.so Jun 22 22:48:09 robin dovecot: IMAP(stef): Effective uid=1000, gid=1000, home=/var/mail/stef Jun 22 22:48:09 robin dovecot: IMAP(stef): dbox: data=/var/mail/stef Jun 22 22:48:09 robin dovecot: IMAP(stef): fs: root=/var/mail/stef, index=, control=, inbox= Jun 22 22:48:09 robin dovecot: IMAP(stef): Disconnected: Logged out bytes=44/298 (...) Jun 22 22:48:56 robin deliver(stef): Loading modules from directory: /usr/lib/dovecot/lda Jun 22 22:48:56 robin deliver(stef): Module loaded: /usr/lib/dovecot/lda/lib20_expire_plugin.so Jun 22 22:48:56 robin deliver(stef): Module loaded: /usr/lib/dovecot/lda/lib90_cmusieve_plugin.so Jun 22 22:48:56 robin deliver(stef): dbox: data=/home/stef/ Jun 22 22:48:56 robin deliver(stef): fs: root=/home/stef, index=, control=, inbox= Jun 22 22:48:56 robin deliver(stef): cmusieve: Using sieve path: /home/stef/.dovecot.sieve Jun 22 22:48:56 robin deliver(stef): cmusieve: Executing script /home/stef/.dovecot.sievec Jun 22 22:48:56 robin deliver(stef): msgid=<05b564d81f8186e0fecc293288ba5eb9.squirrel@www.bunderbos>: saved mail to INBOX
I did restart the dovecot daemon after each configuration change, but I didn't restart postfix, did I have to?
Kr,
Stef
-- Stef Simoens stef.simoens@numericable.be +32 486 577 963 http://users.numericable.be/stef
On Mon, 2009-06-22 at 23:19 +0200, Stef Simoens wrote:
Jun 22 22:48:56 robin deliver(stef): dbox: data=/home/stef/
Oh, so it's only deliver that's broken. I guess you aren't giving -d parameter to deliver so it's not doing a userdb lookup. But there's no need to add it, just keep what you had originally:
mail_location = dbox:/var/mail/%u
expire-tool (and imap, pop3, etc.) will just override it from the mail returned by userdb lookup.
Timo Sirainen schreef:
Hello Timo,
This works. Thanks for your investigation and time.
deliver uses mail_location = dbox:/var/mail/%u -- my e-mail gets delivered correctly
and all the other compontents use the path from userdb. I used "args = home=/var/home/%u mail=dbox:/var/mail/%u" -- and my e-mail gets expired correctly, too
Kind regards,
Stef
-- Stef Simoens stef.simoens@numericable.be +32 486 577 963 http://users.numericable.be/stef
participants (4)
-
Charles Marcus
-
Scott Silva
-
Stef Simoens
-
Timo Sirainen