如何正确使用 doveadm -A

如何正确使用 doveadm -A

我想使用 doveadm 来删除(以及更多)。当我运行

 doveadm search -u '[email protected]' mailbox Trash savedbefore 90d

它可以工作。但是当我使用 -A 时,它却不工作。

 doveadm search -A mailbox Trash savedbefore 90d

结果是(带调试选项)

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

我的 dovecot.conf 有趣的设置:

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 = [email protected]
  sendmail_path = /usr/sbin/sendmail
}
mail_plugins = $mail_plugins expire
plugin {
  expire = Trash
  expire = Trash/*
  expire = Spam
  expire_dict = proxy::expire
}

我的 userdb 在 postgresql 中,并且 dovecot-sql.conf.ext 已取消注释 iterate_query:

# Query to get a list of all usernames.
iterate_query = SELECT address AS user FROM users

我猜是因为我从 root 运行它,所以它会尝试查找系统用户数据库,但它应该使用 sql 用户数据库。但不知道如何强制执行。我尝试使用 -S,但不知道该怎么做。

相关内容