LEVAI Daniel
2010-Oct-19 08:25 UTC
[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
Timo Sirainen
2010-Oct-19 12:46 UTC
[Dovecot] doveadm-expunge not expunging when ran from cron
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 1dYou 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. -------------- next part -------------- A non-text attachment was scrubbed... Name: diff Type: text/x-patch Size: 393 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20101019/a10e7761/attachment-0002.bin>
LEVAI Daniel
2010-Oct-19 13:49 UTC
[Dovecot] doveadm-expunge not expunging when ran from cron
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