大网数据广告活动
服务器运维问答

Migrate from old to new postfix/dovecot mail server

· 52CE 我爱测

In short: Does anyone know of a step-by-step guide to migrate maildir data from one dovecot to another? In long: I try to migrate my mail server to a new machine. Old server postfix/dovecot Step-by-Step Guide: https://www.debinux…

问题原文

原帖链接 · andymel · CC BY-SA 4.0

In short: Does anyone know of a step-by-step guide to migrate maildir data from one dovecot to another?

In long: I try to migrate my mail server to a new machine.

I first tried to simply tar & rsync my single maildir directory but all subfolders were grayed out in thunderbird.

So I thought I do it again with doveadm sync but now I simply find no clear path how to do it with the dovecot manual, google or serverfault.

Is there really no easy step-by-step guide to do this available yet? Or is it just too easy and I don't get it? The manual does not contain enough explanation for a mailserver noob like me.

  1. doveadm sync/backup

    I started with doveadm backup -u [email omitted] .... It tells me:

    doveadm(root): Error: User doesn't exist

    But doveadm user *@domain.tld returns exactly this user. Now I stumbled upon the point below, so I don't try to understand this problem for now.

  2. doveadm import

    As I already have the data tar & rsynced to my new machine I tried this next.

    I started the docker container without ports open so dovecot is running but none can connect to postfix or dovecot.

    I attached to the console of the container and tried doveadm import. Got permission denied issues. Tried with permissions set to 777. doveadm import finished without telling me about any problems but the dir of the user is still empty (just the standard folders no mails)

已采纳解答

原帖链接 · andymel · CC BY-SA 3.0

The reason for me not being successful with finding a good dovecot<->dovecot copy guide was that there is an easy and more generic imap<->imap way of doing it. (For example ImapSync Thanks Sven for your comment to my question).

ImapSync: I did it this way.

  1. Download the code from github and build it
  2. use it

Necessary dependencies for the build

apt-get install makepasswd rcs perl-doc libio-tee-perl git libmail-imapclient-perl libdigest-md5-file-perl libterm-readkey-perl libfile-copy-recursive-perl build-essential make automake libunicode-string-perl libauthen-ntlm-perl libcrypt-ssleay-perl libdigest-hmac-perl libfile-copy-recursive-perl libio-compress-perl libio-socket-inet6-perl libio-socket-ssl-perl libio-tee-perl libmodule-scandeps-perl libnet-ssleay-perl libpar-packer-perl libreadonly-perl libterm-readkey-perl libtest-pod-perl libtest-simple-perl libunicode-string-perl liburi-perl cpanminus

CPAN modules (CPAN = Comprehensive Perl Archive Network)

 cpanm JSON::WebToken Test::MockObject Unicode::String Data::Uniqid

Then get the imapsync code from github and build with make install

When done, using it is as easy as

imapsync \
    --host1 test1.lamiral.info --user1 test1 --password1 secret1 \
    --host2 test2.lamiral.info --user2 test2 --password2 secret2

More details here

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-03-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。