Dovecot 文档远非完美,因此我有点困惑如何将邮件从 Gmail 传送到本地 Dovecot。
看:https://wiki.dovecot.org/Migration/Gmail
经过一番努力,我终于实现了一个用户的同步,但是有没有什么可以针对 Gmail 及其不寻常的标签/虚拟文件夹进行调整呢?
我是否理解正确,每个 gmail 用户必须单独同步,即通过循环,因为无法将多个密码用户文件写入(doveadm backup -F $file
)。
IIUC 远程用户必须在本地 Dovecot 中进行配置。
我目前有:
# egrep -v '^(#|[ \t]*$)' /etc/dovecot/conf.d/99-migration.conf
imapc_host = imap.gmail.com
imapc_features = rfc822.size
imapc_features = $imapc_features fetch-headers
mail_prefetch_count = 20
imapc_port = 993
imapc_ssl = imaps
imapc_ssl_verify = yes
imapc_features = gmail-migration
# sed -n '/^namespace inbox/,/^}/p' /etc/dovecot/conf.d/10-mail.conf | \
egrep -v '^([ \t]*#|[ \t]*$)'
namespace inbox {
separator = /
inbox = yes
}
正在进行同步:
# doveadm -v -o [email protected] -o \
imapc_password='gmailuser_password' backup -O '-$GmailHaveLabels' \
-R -x '\Flagged' -x '\Important' -u [email protected] imapc:
同步后,我得到了这个:
# ls -lF /mail/example.com/data/gmailuser/Maildir/
total 112
drwx------ 5 localuser localgroup 512 Jan 13 22:45 .[Gmail].All Mail/
drwx------ 5 localuser localgroup 512 Jan 13 22:46 .[Gmail].Drafts/
drwx------ 5 localuser localgroup 512 Jan 13 22:46 .[Gmail].Sent Mail/
drwx------ 5 localuser localgroup 512 Jan 13 22:46 .[Gmail].Spam/
drwx------ 5 localuser localgroup 512 Jan 13 22:46 .[Gmail].Trash/
drwx------ 2 localuser localgroup 3072 Jan 13 22:44 cur/
-rw------- 1 localuser localgroup 6 Jan 13 22:30 dovecot-keywords
-rw------- 1 localuser localgroup 3684 Jan 13 22:43 dovecot-uidlist
-rw------- 1 localuser localgroup 8 Jan 13 22:43 dovecot-uidvalidity
-r--r--r-- 1 localuser localgroup 0 Jan 13 22:30 dovecot-uidvalidity.5c3c0276
-rw------- 1 localuser localgroup 21808 Jan 13 22:44 dovecot.index.cache
-rw------- 1 localuser localgroup 3148 Jan 13 22:44 dovecot.index.log
-rw------- 1 localuser localgroup 240 Jan 13 22:43 dovecot.mailbox.log
-rw------- 1 localuser localgroup 0 Jan 13 22:30 maildirfolder
drwx------ 2 localuser localgroup 512 Jan 13 22:43 new/
-rw------- 1 localuser localgroup 117 Jan 13 22:30 subscriptions
drwx------ 2 localuser localgroup 512 Jan 13 22:43 tmp/