Dovecot

從 mdbox 遷移 Dovecot 郵件

  • October 3, 2019

我正在嘗試基於https://wiki.dovecot.org/Migration/MailFormat將 mdbox 遷移到 maildir

我修改了 dovecot.conf 並設置mail_location=maildir:/tmp/destination/mailboxes/

然後我跑了

/mnt/testmail/bin/dsync -Dv -u user@domain.com mirror mdbox:/source/mailboxes/user@domain.com

但這什麼也沒做。然後我修改了 dovecot.conf 並設置mail_location=mdbox:/source/mailboxes

然後我跑了

/mnt/testmail/bin/dsync -Dv -u user@domain.com mirror mdbox:/tmp/destination/mailboxes/user@domain.com

通過 user@domain.com 郵箱從源複製到目標位置。由於那是有效的,我試圖執行

/mnt/testmail/bin/dsync -Dv -u user@domain.com mirror maildir:/tmp/destination/mailboxes/user@domain.com

但這有一個錯誤:

dsync(user@domain.com): 調試: 命名空間收件箱: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/mnt/testmail/mailboxes dsync (user@domain.com):錯誤:使用者初始化失敗:命名空間’’:未知的郵件儲存驅動程序 maildir

第一個問題是,根據上面的範例 #2,https ://wiki.dovecot.org/Migration/MailFormat 中提供的語法不正確,或者由於某種原因對我不起作用,例如 #1。

第二個問題是無法辨識 maildir 格式——那又如何呢?Docecot 有一些缺失的庫嗎?

Dovecot 版本 2.2.18 和配置如下:

# 2.2.18: /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.8
# OS: Linux 2.6.32-754.14.2.el6.x86_64 x86_64 CentOS release 6.10 (Final) xfs
auth_master_user_separator = *
auth_mechanisms = plain login
dict {
 acl = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
}
disable_plaintext_auth = no
lda_mailbox_autosubscribe = yes
log_path = /var/log/dovecot.log
mail_home = mdbox:/var/homedirs/%2Mu/%2.2Mu/%u
mail_location = mdbox:/var/mailboxes/%2Mu/%2.2Mu/%u
mail_plugins = acl
mail_shared_explicit_inbox = yes
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate vnd.dovecot.pipe vnd.dovecot.filter vnd.dovecot.execute
namespace {
 list = children
 location = mdbox:/var/mailboxes/%%2Mu/%%2.2Mu/%%u
 prefix = shared/%%u/
 separator = /
 subscriptions = yes
 type = shared
}
namespace inbox {
 inbox = yes
 location =
 mailbox Drafts {
   auto = subscribe
   special_use = \Drafts
 }
 mailbox INBOX {
   auto = subscribe
 }
 mailbox Junk {
   special_use = \Junk
 }
 mailbox Sent {
   auto = subscribe
   special_use = \Sent
 }
 mailbox "Sent Messages" {
   special_use = \Sent
 }
 mailbox Trash {
   auto = subscribe
   special_use = \Trash
 }
 prefix =
 subscriptions = yes
}
passdb {
 args = /etc/dovecot/mastership-sql.conf
 driver = sql
 master = yes
 pass = yes
}
passdb {
 args = /etc/dovecot/dovecot-sql.conf.ext
 driver = sql
}
plugin {
 acl = vfile
 acl_defaults_from_inbox = yes
 acl_shared_dict = proxy::acl
 sieve_after = /etc/dovecot/sieve/99-file-qvera-ccda.sieve
 sieve_after2 = /etc/dovecot/sieve/98-notify-biz-address.sieve
 sieve_after3 = /etc/dovecot/sieve/97-mdn-processed.sieve
 sieve_execute_bin_dir = /etc/dovecot/sieve-execute
 sieve_execute_socket_dir = sieve-execute
 sieve_extensions = +vnd.dovecot.execute +vnd.dovecot.filter +vnd.dovecot.pipe
 sieve_filter_bin_dir = /etc/dovecot/sieve-filter
 sieve_filter_socket_dir = sieve-filter
 sieve_pipe_bin_dir = /etc/dovecot/sieve-pipe
 sieve_pipe_socket_dir = sieve-pipe
 sieve_plugins = sieve_extprograms
}
postmaster_address = postmaster@test2.domain.com
sendmail_path = /sbin/sendmail
service dict {
 unix_listener dict {
   user = dovecot
 }
}
service imap-postlogin {
 executable = script-login /etc/dovecot/imappostlogin
 user = $default_internal_user
}
service imap {
 executable = imap imap-postlogin
}
ssl = no
userdb {
 args = uid=dovecot gid=dovecot home=/var/mailboxes/%%2Mu/%%2.2Mu/%%u
 driver = static
}
protocol lmtp {
 mail_plugins = acl sieve
}
protocol lda {
 mail_plugins = acl sieve
}
protocol imap {
 mail_plugins = acl imap_acl
}

很有可能是自定義編譯。

我想我需要重新編譯 Dovecot

--with-storages=mdbox,imapc,sdbox,maildir,mbox

使配置缺少郵件儲存格式

引用自:https://serverfault.com/questions/972416