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.
- 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@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
- passwd-file contains home directory only (->not working!)
/etc/dovecot/dovecot.users: foo:{plain}xxxx:2004:100::/home/foo
root@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@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
On Wed, 2008-09-03 at 13:06 +0200, e-frog wrote:
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.
Does it help if you run "unset HOME" and "unset MAIL" before running expire-tool?
Although I guess I should look into it why it's not working right. :)
Does it help if you run "unset HOME" and "unset MAIL" before running expire-tool?
Although I guess I should look into it why it's not working right. :)
Not really :)
Unsetting MAIL -> same result:
# 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
Unsetting HOME in addition:
# dovecot --exec-mail ext /usr/local/libexec/dovecot/expire-tool --test Info: maildir: data=/Maildir Info: maildir++: root=/Maildir, index=, control=, inbox=/Maildir Info: Trash: no messages left
So it seems to use the home directory from the user executing the expire-tool.
On Thu, 2008-09-11 at 18:45 +0200, e-frog wrote:
So it seems to use the home directory from the user executing the expire-tool.
This should help: http://hg.dovecot.org/dovecot-1.1/rev/e6cd18cbd698
On Thu, 2008-09-11 at 18:45 +0200, e-frog wrote:
So it seems to use the home directory from the user executing the expire-tool.
This should help: http://hg.dovecot.org/dovecot-1.1/rev/e6cd18cbd698
Yes, now it's working. Thanks Timo!
participants (2)
-
e-frog
-
Timo Sirainen