[Dovecot] doveadm-expunge not expunging when ran from cron

LEVAI Daniel leva at ecentrum.hu
Tue Oct 19 11:25:22 EEST 2010


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


More information about the dovecot mailing list