I was struggling for a while to get the expire plugin to expunge mail. I
was using (and still would like to use) PAM as passdb and passwd as
userdb but with this I could not get the expire-tool to delete any
mails. For debugging purpose I switch to passwd-file as userdb/passdb
and enabled mail_debug=yes.
1. passwd-file contains home directory and userdb_mail (->working!)
/etc/dovecot/dovecot.users:
foo:{plain}xxxx:2004:100::/home/foo::userdb_mail=maildir:~/Maildir
root at mail:# dovecot --exec-mail ext
/usr/local/libexec/dovecot/expire-tool --test
Info: maildir: data=~/Maildir
Info: maildir++: root=/home/foo/Maildir, index=, control=,
inbox=/home/foo/Maildir
Info: Trash: seq=1 uid=2586: Expunge
Info: Trash: timestamp 1220392046 -> 1220451447
2. passwd-file contains home directory only (->not working!)
/etc/dovecot/dovecot.users:
foo:{plain}xxxx:2004:100::/home/foo
root at mail:# dovecot --exec-mail ext
/usr/local/libexec/dovecot/expire-tool --test
Info: maildir: data=/root/Maildir
Info: maildir++: root=/root/Maildir, index=, control=, inbox=/root/Maildir
Error: stat(/root/Maildir/.Trash/tmp) failed: Permission denied
(euid=2005 egid=100)
The expire-tool doesn't find foo's mailbox even if mail_location is set
global in the configuration file (please see below). This is exactly the
same result as when using PAM and passwd. So I guess there is something
wrong with user lookup or setting/expanding HOME and MAIL in the
expire-tool.
root at mail:# dovecot -n
# 1.1.3: /etc/dovecot/dovecot.conf
log_path: /var/log/mail/dovecot.log
info_log_path: /var/log/mail/dovecot.log
ssl_disable: yes
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable: /usr/local/libexec/dovecot/imap-login
login_process_size: 16
max_mail_processes: 16
mail_location: maildir:~/Maildir
mail_debug: yes
mail_process_size: 64
mail_plugins: quota imap_quota expire
auth default:
passdb:
driver: passwd-file
args: scheme=plain /etc/dovecot/dovecot.users
userdb:
driver: passwd-file
args: /etc/dovecot/dovecot.users
socket:
type: listen
client:
path: /var/run/dovecot/auth-client
mode: 432
user: dovecot
group: mail
master:
path: /var/run/dovecot/auth-master
mode: 384
plugin:
quota: maildir
quota_rule: *:storage=1GB
quota_rule2: Trash:storage=10%%
expire: Trash 1 Junk 1
expire_dict: proxy::expiredict
dict:
expiredict: db:/var/lib/dovecot/expire.db