I'd like to use doveadm to expunge (and more). When I run
doveadm search -u 'some@email.com' mailbox Trash savedbefore 90d
it works. But when I use -A, it doesn't.
doveadm search -A mailbox Trash savedbefore 90d
The result is (with debug option)
doveadm(root): Error: userdb list: Request timed out
doveadm(root): Debug: expire: Couldn't optimize search query: mailbox Trash not in expire database
doveadm: Error: Failed to iterate through some users
my dovecot.conf interesting settings:
first_valid_gid = 107
first_valid_uid = 107
last_valid_gid = 107
last_valid_uid = 107
protocols = imap
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
unix_listener auth-master {
group = mail
mode = 0666
user = vmail
}
user = nobody
}
protocol imap {
mail_plugins = $mail_plugins imap_acl
}
protocol lda {
auth_socket_path = /var/run/dovecot/auth-master
hostname = brzezina.com.pl
mail_plugin_dir = /usr/lib/dovecot/modules/
mail_plugins = sieve
postmaster_address = postmaster@brzezina.com.pl
sendmail_path = /usr/sbin/sendmail
}
mail_plugins = $mail_plugins expire
plugin {
expire = Trash
expire = Trash/*
expire = Spam
expire_dict = proxy::expire
}
My userdb is in postgresql, and dovecot-sql.conf.ext has iterate_query uncommented:
# Query to get a list of all usernames.
iterate_query = SELECT address AS user FROM users
I suppose, that because I run it from root, it tries to find system userdb but it should use sql userdb. But don't know how to force it. I tried to use -S but don't know what.