Dovecot - 无法将电子邮件移出收件箱

Dovecot - 无法将电子邮件移出收件箱

背景...我的 Ubuntu 20 服务器中的 HDD 坏了。我在一台全新的机器上构建了一台 Ubuntu 20 服务器,然后尽可能地将出错的 HDD 移至全新的 RAID。

此举的一部分是 postfix/dovecot。移动的后缀部分成功,邮件正在传入并添加到正确的邮件文件收件箱中。

不过,此举的鸽舍部分并不是那么成功。所有电子邮件都正确显示在收件箱中,使用 Thunderbird 进行邮件过滤似乎可以工作,但有一个“但是”。发生的情况是邮件被移动到正确的文件夹并从收件箱中消失。选择包含已移动电子邮件的邮箱将显示文件夹中的电子邮件,直到再次选择收件箱。然后,所有移动的邮件再次显示为新邮件,但目标文件夹中仍有电子邮件的副本。再次运行过滤器会将文件移(复制)回正确的文件夹,从而导致目标文件夹中存在同一封电子邮件的多个副本。

所有查找问题的努力都表明问题仅限于收件箱中的电子邮件。

该问题不仅在 Thunderbird 过滤时很明显,而且在使用删除键时也很明显。删除电子邮件的唯一方法是避免使用 Shift + delete 将电子邮件移动到已删除的文件夹。

鸽舍配置

mike@wilma:/var/imap$ sudo dovecot -n
# 2.3.7.2 (3c910f64b): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.7.2 ()
# OS: Linux 5.4.0-96-generic x86_64 Ubuntu 20.04.3 LTS ext4
# Hostname: wilma.example.com
auth_debug = yes
auth_verbose = yes
auth_verbose_passwords = plain
debug_log_path = /var/log/dovecot/debug.log
disable_plaintext_auth = no
info_log_path = /var/log/dovecot/info.log
log_path = /var/log/dovecot/warnings.log
mail_access_groups = mail
mail_debug = yes
mail_gid = mail
mail_location = mbox:/var/imap/%d/%n/mail/:INBOX=/var/virtual/%d/%n:LAYOUT=fs
mail_privileged_group = mail
mail_uid = nobody
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix = 
}
passdb {
  driver = passwd
}
passdb {
  args = username_format=%n /etc/virtual/%d/passwd
  driver = passwd-file
}
plugin {
  mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
  sieve = file:~/sieve;active=~/.dovecot.sieve
}
protocols = " imap pop3"
service auth {
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
  }
}
service imap-postlogin {
  executable = script-login /etc/dovecot/lastLogin.sh
  unix_listener imap-postlogin {
    user = root
  }
}
service imap {
  executable = imap imap-postlogin
}
ssl_cert = </etc/letsencrypt/live/Email_cert/fullchain.pem
ssl_client_ca_dir = /etc/ssl/certs
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
verbose_ssl = yes

文件系统快照...

mike@wilma:/var/imap$ sudo find . ! -user nobody -o ! -group mail -ls
-- no output --
mike@wilma:/var/imap$ sudo ls -l example.com/mike/mail/Facebook
-rw-rw-r-- 1 nobody mail 16689445 Jan 25 11:26 example.com/mike/mail/Facebook
mike@wilma:/var/imap$ sudo ls -ld example.com/mike/mail
drwxrwxr-x 13 nobody mail 4096 Jan 25 12:03 example.com/mike/mail
mike@wilma:/var/imap$ sudo ls -ld example.com/mike
drwxrwxr-x 3 nobody mail 4096 Jan 23 21:19 example.com/mike
mike@wilma:/var/imap$ sudo ls -ld example.com
drwx-wx--x 5 nobody mail 4096 Jan 23 21:20 example.com

我不太确定还有哪些其他信息对您有用

蒂亚·迈克

尝试了这个,但没有达到预期的结果,电子邮件仍然在被删除 2 秒后弹出......

root@wilma:/var/imap# doveadm -v -D force-resync -u [email protected] INBOX
Debug: Loading modules from directory: /usr/lib/dovecot/modules/doveadm
Debug: Skipping module doveadm_acl_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_acl_plugin.so: undefined symbol: acl_user_module (this is usually intentional, so just ignore this message)
Debug: Skipping module doveadm_expire_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_expire_plugin.so: undefined symbol: expire_set_deinit (this is usually intentional, so just ignore this message)
Debug: Skipping module doveadm_quota_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_quota_plugin.so: undefined symbol: quota_user_module (this is usually intentional, so just ignore this message)
Debug: Module loaded: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_sieve_plugin.so
Debug: Skipping module doveadm_fts_lucene_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib20_doveadm_fts_lucene_plugin.so: undefined symbol: lucene_index_iter_deinit (this is usually intentional, so just ignore this message)
Debug: Skipping module doveadm_fts_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib20_doveadm_fts_plugin.so: undefined symbol: fts_user_get_language_list (this is usually intentional, so just ignore this message)
Debug: Skipping module doveadm_mail_crypt_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/libdoveadm_mail_crypt_plugin.so: undefined symbol: mail_crypt_box_get_pvt_digests (this is usually intentional, so just ignore this message)
doveadm([email protected])<59647><>: Debug: auth-master: userdb lookup([email protected]): Started userdb lookup
doveadm([email protected])<59647><>: Debug: auth-master: conn unix:/var/run/dovecot/auth-userdb: Connecting
doveadm([email protected])<59647><>: Debug: auth-master: conn unix:/var/run/dovecot/auth-userdb: Client connected (fd=10)
doveadm([email protected])<59647><>: Debug: auth-master: userdb lookup([email protected]): auth USER input: [email protected] 
doveadm([email protected])<59647><>: Debug: auth-master: userdb lookup([email protected]): Finished userdb lookup ([email protected] )
doveadm([email protected])<59647><>: Debug: Added userdb setting: plugin/=yes
doveadm([email protected]): Debug: Effective uid=65534, gid=8, home=
doveadm([email protected]): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=mbox:/var/imap/example.com/mike/mail/:INBOX=/var/virtual/example.com/mike:LAYOUT=fs
doveadm([email protected]): Debug: fs: root=/var/imap/example.com/mike/mail, index=, indexpvt=, control=, inbox=/var/virtual/example.com/mike, alt=
doveadm([email protected]): Debug: Mailbox INBOX: Mailbox opened because: force-resync
doveadm([email protected]): Debug: auth-master: conn unix:/var/run/dovecot/auth-userdb: Disconnected: Connection closed (fd=10)

日志文件仅显示以下内容

Jan 27 09:20:49 imap([email protected])<60062><0OOA3IHWZozAqAGO>: Debug: Mailbox Trash: Mailbox opened because: UID move
Jan 27 09:20:49 imap([email protected])<60062><0OOA3IHWZozAqAGO>: Debug: Mailbox INBOX: UID 229597: Opened mail because: copying
Jan 27 09:20:49 imap([email protected])<60062><0OOA3IHWZozAqAGO>: Debug: Mailbox INBOX: UID 229597: Opened mail because: full mail

尝试过这个没有效果...

root@wilma:/var/imap/example.com# chmod -R o+w *
root@wilma:/var/imap/example.com# systemctl restart dovecot

还尝试取消订阅所有文件夹。删除了一封邮件,又被退回了。再次订阅,再次删除,电子邮件再次退回。

答案1

这个问题一夜之间就消失了,显然是自行解决的。我无法确切地说我所做的哪一项更改是解决问题的更改。

相关内容