[Dovecot] Automatic expire on post-login

Antonio Perez-Aranda aperezaranda at yaco.es
Thu Nov 25 09:54:04 EET 2010


Yes, -A is a typo error, because a I copy from cronjob. Really, I do
doveadm -u $USER.

Well, I use expungestamp if the overload is very high.

When I execute doveadm -u $user many times, it's not take much time,
lower than 0.1 seconds.

2010/11/24 Timo Sirainen <tss at iki.fi>:
> On 24.11.2010, at 9.47, Antonio Perez-Aranda wrote:
>
>> This is the content of postlogin.sh
>>
>> #!/bin/bash
>> /usr/local/bin/doveadm -D expunge -A mailbox Trash savedbefore 30d
>> /usr/local/bin/doveadm -D expunge -A mailbox MarcaSpam savedbefore 1w
>> exec $*
>
> -A means it goes through all users, which most likely isn't what you want. Rather use -u $USER. Also add some check that this expunging isn't done more than once a day. Something like:
>
> if [ ! -f expungestamp ] || [ `find Makefile -mtime +1d` != "" ]; then
>  touch expungestamp
>  doveadm ..
> fi
>
> Alternatively if this is too slow you could also build a plugin to do this (mostly copy&paste code from doveadm-mail-expunge.c).


More information about the dovecot mailing list