问题原文
原帖链接 · 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.
- Old server
- postfix/dovecot
- Step-by-Step Guide: https://www.debinux.de/2015/05/mailserver-from-scratch-debian-8/
- New Server
- postfix/dovecot but in docker
- Step-by-Step Guide: https://github.com/tomav/docker-mailserver
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.
doveadmsync/backupI started with
doveadm backup -u [email omitted] .... It tells me:doveadm(root): Error: User doesn't exist
But
doveadm user *@domain.tldreturns exactly this user. Now I stumbled upon the point below, so I don't try to understand this problem for now.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
doveadmimport. Got permission denied issues. Tried with permissions set to 777.doveadmimport 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.
- Download the code from github and build it
- 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
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
