[Dovecot] doveadm-expunge not expunging when ran from cron
Hi!
I noticed that this command ... :
for USERNAME in ${USERS};do /usr/local/bin/doveadm -Dv expunge -u "${USERNAME}" mailbox sa.* SAVEDBEFORE 1d done
... does not expunge mails if ran from crontab. It shows in the Debug output what would have been done, but it doesn't really expunge those mails. This command runs daily, and every day the list of expunged mails (in the Debug output) just grows and grows, and the sa.* directories stay the same (except the new mails of course). However, if I run it from a terminal it really expunges the mails.
Example output: doveadm(root): Debug: Loading modules from directory: /usr/local/lib/dovecot doveadm(root): Debug: Module loaded: /usr/local/lib/dovecot/lib10_quota_plugin.so doveadm(root): Debug: Loading modules from directory: /usr/local/lib/dovecot/doveadm doveadm(root): Debug: Skipping module doveadm_expire_plugin, because dlopen() failed: Cannot load specified object (this is usually intentional, so just ignore this message) doveadm(root): Debug: Module loaded: /usr/local/lib/dovecot/doveadm/lib10_doveadm_quota_plugin.so doveadm("${USERNAME}"): Debug: expunge: box=sa.spam uid=6657 doveadm("${USERNAME}"): Debug: expunge: box=sa.spam uid=6658 doveadm("${USERNAME}"): Debug: expunge: box=sa.spam uid=6659 doveadm("${USERNAME}"): Debug: expunge: box=sa.spam uid=6660 doveadm("${USERNAME}"): Debug: expunge: box=sa.spam uid=6661 doveadm("${USERNAME}"): Debug: expunge: box=sa.spam uid=6662 [...]
If ran from cron, then the same uids show up every day, and new ones gets added (as new mails gets copied into those directories).
Is there something fishy going on in doveadm-expunge if it has no controlling terminal?
Thanks, Daniel
-- LÉVAI Dániel PGP key ID = 0x83B63A8F Key fingerprint = DBEC C66B A47A DFA2 792D 650C C69B BE4C 83B6 3A8F
On Tue, 2010-10-19 at 10:25 +0200, LEVAI Daniel wrote:
for USERNAME in ${USERS};do /usr/local/bin/doveadm -Dv expunge -u "${USERNAME}" mailbox sa.* SAVEDBEFORE 1d
You should put sa.* around '' just in case there exists any filenames matching sa.*
... does not expunge mails if ran from crontab. It shows in the Debug output what would have been done, but it doesn't really expunge those mails. This command runs daily, and every day the list of expunged mails (in the Debug output) just grows and grows, and the sa.* directories stay the same (except the new mails of course). However, if I run it from a terminal it really expunges the mails.
Weird. Does it log with attached patch that commit was successful?
Is there something fishy going on in doveadm-expunge if it has no controlling terminal?
Nothing I can think of.
On Tue, Oct 19, 2010 at 13:46:17 +0100, Timo Sirainen wrote: [...]
Weird. Does it log with attached patch that commit was successful? [...]
THanks, I'm testing this now.
Daniel
-- LÉVAI Dániel PGP key ID = 0x83B63A8F Key fingerprint = DBEC C66B A47A DFA2 792D 650C C69B BE4C 83B6 3A8F
On Tue, Oct 19, 2010 at 13:46:17 +0100, Timo Sirainen wrote: [...]
Weird. Does it log with attached patch that commit was successful? [...]
THanks, I'm testing this now. Yes, it shows that the commit was successful, but the mails remain in
On Tue, Oct 19, 2010 at 15:49:46 +0200, LEVAI Daniel wrote: the mailbox. Here is how it progresses in three days:
2010.10.20: doveadm($(USERNAME}): Debug: expunge: box=sa.spam uid=6752 doveadm($(USERNAME}): Debug: expunge: box=sa.spam uid=6753 doveadm($(USERNAME}): Debug: expunge: box=sa.spam uid=6754 [.>.] doveadm($(USERNAME}): Debug: expunge: box=sa.spam uid=6756 doveadm($(USERNAME}): Debug: commit successful doveadm($(USERNAME}): Debug: commit successful
2010.10.21: doveadm($(USERNAME}): Debug: expunge: box=sa.spam uid=6752 doveadm($(USERNAME}): Debug: expunge: box=sa.spam uid=6753 doveadm($(USERNAME}): Debug: expunge: box=sa.spam uid=6754 [.>.] doveadm($(USERNAME}): Debug: expunge: box=sa.spam uid=6777 doveadm($(USERNAME}): Debug: commit successful doveadm($(USERNAME}): Debug: commit successful
2010.10.22: doveadm($(USERNAME}): Debug: expunge: box=sa.spam uid=6752 doveadm($(USERNAME}): Debug: expunge: box=sa.spam uid=6753 doveadm($(USERNAME}): Debug: expunge: box=sa.spam uid=6754 [.>.] doveadm($(USERNAME}): Debug: expunge: box=sa.spam uid=6795 doveadm($(USERNAME}): Debug: commit successful doveadm($(USERNAME}): Debug: commit successful
This was only running from cron.
Daniel
-- LÉVAI Dániel PGP key ID = 0x83B63A8F Key fingerprint = DBEC C66B A47A DFA2 792D 650C C69B BE4C 83B6 3A8F
On Fri, 2010-10-22 at 08:41 +0200, LEVAI Daniel wrote:
On Tue, Oct 19, 2010 at 13:46:17 +0100, Timo Sirainen wrote: [...]
Weird. Does it log with attached patch that commit was successful? [...]
THanks, I'm testing this now. Yes, it shows that the commit was successful, but the mails remain in
On Tue, Oct 19, 2010 at 15:49:46 +0200, LEVAI Daniel wrote: the mailbox. Here is how it progresses in three days:
Well, I don't know why it would make a difference when running from cron, but I guess this'll fix it: http://hg.dovecot.org/dovecot-2.0/rev/d991b5c99397
On h, okt 25, 2010 at 16:28:13 +0100, Timo Sirainen wrote:
On Fri, 2010-10-22 at 08:41 +0200, LEVAI Daniel wrote:
On Tue, Oct 19, 2010 at 13:46:17 +0100, Timo Sirainen wrote: [...]
Weird. Does it log with attached patch that commit was successful? [...]
THanks, I'm testing this now. Yes, it shows that the commit was successful, but the mails remain in
On Tue, Oct 19, 2010 at 15:49:46 +0200, LEVAI Daniel wrote: the mailbox. Here is how it progresses in three days:
Well, I don't know why it would make a difference when running from cron, but I guess this'll fix it: http://hg.dovecot.org/dovecot-2.0/rev/d991b5c99397
That's it! Thank you very much. It is now really expunges the mails from the directory!
Thanks a ton, as always! Daniel
-- LÉVAI Dániel PGP key ID = 0x83B63A8F Key fingerprint = DBEC C66B A47A DFA2 792D 650C C69B BE4C 83B6 3A8F
participants (2)
-
LEVAI Daniel
-
Timo Sirainen