[Dovecot] Mail migration to dovecot with doveadm backup
Hi,
i try to migrate mails from a non dovecot imap server to a dovecot imap server with doveadm backup as described there:
http://wiki2.dovecot.org/Migration/Dsync
i first tried (local-mailbox port 18143 is the non dovecot imap server):
/usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mailbox_list_index=no -v -D backup -R -f -u user@example.org -m Sent imapc:
and got the following error:
dsync(user@example.org): Fatal: dsync backup: Looks like you're trying to run backup in wrong direction. Source is empty and destination is not.
As the dovecot imap account is newly created and therefore empty it seams to try to backup from the dovecot imap server to the non dovecot imap server. So i tried instead:
/usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mailbox_list_index=no -v -D backup -f -u user@example.org -m Sent imapc:
Sometimes (every other time?) i got the following segmentation fault:
bt
#0 0x00007f15e2c9ed74 in strcasecmp () from /lib/libc.so.6
#1 0x00007f15e327eaff in imapc_save_callback (reply=0x7fff56096a70,
context=<value optimized out>) at imapc-save.c:168
#2 0x00007f15e32853fe in imapc_command_reply_free (conn=0x72f040) at
imapc-connection.c:946
#3 imapc_connection_input_tagged (conn=0x72f040) at imapc-connection.c:1039
#4 0x00007f15e3285668 in imapc_connection_input_one (conn=0x72f040) at
imapc-connection.c:1085
#5 imapc_connection_input_pending (conn=0x72f040) at
imapc-connection.c:1407
#6 0x00007f15e3285922 in imapc_connection_input (conn=0x72f040) at
imapc-connection.c:1100
#7 0x00007f15e2fe6176 in io_loop_call_io (io=0x792510) at ioloop.c:379
#8 0x00007f15e2fe71ff in io_loop_handler_run (ioloop=<value optimized
out>) at ioloop-epoll.c:213
#9 0x00007f15e2fe6118 in io_loop_run (ioloop=0x7529a0) at ioloop.c:398
#10 0x00007f15e3281e49 in imapc_client_run_pre (client=0x7333e0) at
imapc-client.c:142
#11 imapc_client_run (client=0x7333e0) at imapc-client.c:161
#12 0x00007f15e3280f24 in imapc_storage_run (storage=0x732bd0) at
imapc-storage.c:118
#13 0x00007f15e327f003 in imapc_save_append (_ctx=0x74dcb0) at
imapc-save.c:232
#14 imapc_save_finish (_ctx=0x74dcb0) at imapc-save.c:255
#15 0x00007f15e1bf06a1 in quota_save_finish (ctx=0x74dcb0) at
quota-storage.c:227
#16 0x00007f15e3292487 in mailbox_save_finish (_ctx=0x7f15e2d4ca40) at
mail-storage.c:1669
#17 0x000000000042b736 in local_worker_save_msg_continue
(worker=0x73c770) at dsync-worker-local.c:1681
#18 0x000000000042b98c in local_worker_msg_save (_worker=0x73c770,
msg=0x7f15e38e4298, data=0x7fff56096db0, callback=0x4269f0
The other times it shows the following error message (It seams to connect both times to the non dovecot imap server):
doveadm(root): Debug: Loading modules from directory: /usr/lib/dovecot/modules doveadm(root): Debug: Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so doveadm(root): Debug: Loading modules from directory: /usr/lib/dovecot/modules/doveadm doveadm(root): 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) doveadm(root): Debug: Skipping module doveadm_expire_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_expire_plugin.so: undefined symbol: expire_set_lookup (this is usually intentional, so just ignore this message) doveadm(root): Debug: Module loaded: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_quota_plugin.so doveadm(root): Debug: Skipping module doveadm_zlib_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_zlib_plugin.so: undefined symbol: i_stream_create_deflate (this is usually intentional, so just ignore this message) doveadm(root): Debug: Skipping module doveadm_fts_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib20_doveadm_fts_plugin.so: undefined symbol: fts_list_backend (this is usually intentional, so just ignore this message) doveadm(user@example.org): Debug: auth input: user@example.org home=/mail/dovecot/example.org/user uid=1000 gid=1000 quota_rule=*:bytes=2000M:messages=0 doveadm(user@example.org): Debug: Added userdb setting: plugin/quota_rule=*:bytes=2000M:messages=0 doveadm(user@example.org): Debug: Effective uid=1000, gid=1000, home=/mail/dovecot/example.org/user doveadm(user@example.org): Debug: Quota root: name=User quota backend=dict args=:proxy::quota doveadm(user@example.org): Debug: Quota rule: root=User quota mailbox=* bytes=2097152000 messages=0 doveadm(user@example.org): Debug: Quota rule: root=User quota mailbox=Trash bytes=+104857600 messages=0 doveadm(user@example.org): Debug: Quota warning: bytes=1992294400 (95%) messages=0 reverse=no command=quota-warning 95 user@example.org doveadm(user@example.org): Debug: Quota warning: bytes=1677721600 (80%) messages=0 reverse=no command=quota-warning 80 user@example.org doveadm(user@example.org): Debug: dict quota: user=user@example.org, uri=proxy::quota, noenforcing=0 doveadm(user@example.org): Debug: fs: root=/mail/dovecot/example.org/user/mail, index=, control=, inbox=, alt= doveadm(user@example.org): Debug: Namespace : Using permissions from /mail/dovecot/example.org/user/mail: mode=0700 gid=-1 dsync(user@example.org): Debug: Effective uid=1000, gid=1000, home=/mail/dovecot/example.org/user dsync(user@example.org): Debug: Quota root: name=User quota backend=dict args=:proxy::quota dsync(user@example.org): Debug: Quota rule: root=User quota mailbox=* bytes=2097152000 messages=0 dsync(user@example.org): Debug: Quota rule: root=User quota mailbox=Trash bytes=+104857600 messages=0 dsync(user@example.org): Debug: Quota warning: bytes=1992294400 (95%) messages=0 reverse=no command=quota-warning 95 user@example.org dsync(user@example.org): Debug: Quota warning: bytes=1677721600 (80%) messages=0 reverse=no command=quota-warning 80 user@example.org dsync(user@example.org): Debug: dict quota: user=user@example.org, uri=proxy::quota, noenforcing=0 dsync(user@example.org): Debug: imapc: root=, index=, control=, inbox=, alt= dsync(user@example.org): Debug: imapc(local-mailbox:18143): Looking up IP address dsync(user@example.org): Debug: imapc(local-mailbox:18143): Connecting to 10.10.10.10:18143 dsync(user@example.org): Debug: imapc(local-mailbox:18143): Server capabilities: IMAP4 IMAP4rev1 AUTH=LOGIN ACL NAMESPACE CHILDREN SORT QUOTA THREAD=ORDEREDSUBJECT UNSELECT IDLE dsync(user@example.org): Debug: imapc(local-mailbox:18143): Authenticating as user@example.org dsync(user@example.org): Debug: imapc(local-mailbox:18143): Authenticated successfully dsync(user@example.org): Debug: imapc(local-mailbox:18143): Looking up IP address dsync(user@example.org): Debug: imapc(local-mailbox:18143): Connecting to 10.10.10.10:18143 dsync(user@example.org): Debug: imapc(local-mailbox:18143): Server capabilities: IMAP4 IMAP4rev1 AUTH=LOGIN ACL NAMESPACE CHILDREN SORT QUOTA THREAD=ORDEREDSUBJECT UNSELECT IDLE dsync(user@example.org): Debug: imapc(local-mailbox:18143): Authenticating as user@example.org dsync(user@example.org): Debug: imapc(local-mailbox:18143): Authenticated successfully dsync(user@example.org): Warning: Destination mailbox Sent has been modified, need to recreate it before we can continue syncing dsync(user@example.org): Warning: Mailbox changes caused a desync. You may want to run dsync again. dsync(user@example.org): Debug: imapc(local-mailbox:18143): Disconnected dsync(user@example.org): Debug: imapc(local-mailbox:18143): Disconnected
i think the problem could be that the account name on the remote server and the local server is absolute identical and doveadm backup has therefore problems discerning between the two locations. But that's only a stab in the dark and any help is appreciated.
Kind regards Reinhard
On 2012-06-24 11:57 AM, Reinhard Vicinus r.vicinus@metaways.de wrote:
i try to migrate mails from a non dovecot imap server to a dovecot imap server with doveadm backup as described there:
What version of dovecot (doveconf -n output_?
http://wiki2.dovecot.org/Migration/Dsync
i first tried (local-mailbox port 18143 is the non dovecot imap server):
/usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mailbox_list_index=no -v -D backup -R -f -u user@example.org -m Sent imapc:
and got the following error:
dsync(user@example.org): Fatal: dsync backup: Looks like you're trying to run backup in wrong direction. Source is empty and destination is not.
--
Best regards,
Charles Marcus I.T. Director Media Brokers International, Inc. 678.514.6200 x224 | 678.514.6299 fax
On 2012-06-24 11:57 AM, Reinhard Vicinus r.vicinus@metaways.de wrote:
i try to migrate mails from a non dovecot imap server to a dovecot imap server with doveadm backup as described there:
What version of dovecot (doveconf -n output_? dovecot -n # 2.1.7: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-40-server x86_64 Ubuntu 10.04.4 LTS auth_cache_negative_ttl = 0 auth_cache_size = 10 M auth_cache_ttl = 1 mins auth_verbose = yes auth_verbose_passwords = sha1 deliver_log_format = mailbox: deliver: msgid=%m from=%f: %$ dict { quota = mysql:/etc/dovecot/conf.d/dovecot-dict-sql.conf.ext } disable_plaintext_auth = no doveadm_password = xxx instance_name = dovecot-mailbox lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes login_greeting = Mailbox login_log_format = mailbox: login: %$: %s login_trusted_networks = 10.10.10.0/24 mail_debug = yes mail_fsync = always mail_gid = vmail mail_home = /mail/dovecot/%d/%n mail_location = mdbox:~/mail mail_log_prefix = "mailbox: mail: %s(%u): " mail_plugins = quota mail_privileged_group = vmail mail_uid = vmail managesieve_implementation_string = Sieve 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 ihave mdbox_rotate_interval = 1 weeks mdbox_rotate_size = 50 M mmap_disable = yes
On 25/06/12 13:39, Charles Marcus wrote: passdb { args = /etc/dovecot/conf.d/dovecot-sql.conf.ext driver = sql } plugin { quota = dict:User quota::proxy::quota quota_rule = *:storage=10G quota_rule2 = Trash:storage=+100M quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=80%% quota-warning 80 %u sieve = ~/.dovecot.sieve sieve_dir = ~/sieve } protocols = imap pop3 lmtp sieve service auth { unix_listener auth-userdb { group = dovecot mode = 0660 user = dovecot } } service dict { unix_listener dict { group = vmail mode = 0660 } } service doveadm { inet_listener doveadm-server { port = 19000 } } service imap-login { inet_listener imap { port = 19143 } } service imap-postlogin { executable = script-login /usr/local/bin/dovecot-postlogin user = $default_internal_user } service imap { executable = imap imap-postlogin } service lmtp { inet_listener lmtp { address = * port = 19024 } } service managesieve-login { inet_listener sieve { port = 19200 } } service pop3-login { inet_listener pop3 { port = 19110 } } service pop3-postlogin { executable = script-login /usr/local/bin/dovecot-postlogin user = $default_internal_user } service pop3 { executable = pop3 pop3-postlogin } service quota-warning { executable = script /usr/local/bin/quota-warning extra_groups = dovecot unix_listener quota-warning { user = vmail } user = vmail } ssl = no userdb { driver = prefetch } userdb { args = /etc/dovecot/conf.d/dovecot-sql.conf.ext driver = sql } verbose_proctitle = yes protocol imap { imap_client_workarounds = delay-newmail tb-extra-mailbox-sep mail_plugins = quota imap_quota } protocol lmtp { mail_plugins = quota sieve }
Hi,
if i delete the home directory and all content below an existing account user@example.org. Then run:
/usr/bin/doveadm quota recalc -u user@example.org
and afterwards:
/usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -D -v backup -R -f -u user@example.org imapc:
i get the following errors:
doveadm(root): Debug: Loading modules from directory: /usr/lib/dovecot/modules doveadm(root): Debug: Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so doveadm(root): Debug: Loading modules from directory: /usr/lib/dovecot/modules/doveadm doveadm(root): 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) doveadm(root): Debug: Skipping module doveadm_expire_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_expire_plugin.so: undefined symbol: expire_set_lookup (this is usually intentional, so just ignore this message) doveadm(root): Debug: Module loaded: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_quota_plugin.so doveadm(root): Debug: Skipping module doveadm_zlib_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_zlib_plugin.so: undefined symbol: i_stream_create_deflate (this is usually intentional, so just ignore this message) doveadm(root): Debug: Skipping module doveadm_fts_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib20_doveadm_fts_plugin.so: undefined symbol: fts_list_backend (this is usually intentional, so just ignore this message) doveadm(user@example.org): Debug: auth input: user@example.org home=/mail/dovecot/example.org/user uid=501 gid=123 quota_rule=*:bytes=2000M:messages=0 doveadm(user@example.org): Debug: Added userdb setting: plugin/quota_rule=*:bytes=2000M:messages=0 doveadm(user@example.org): Debug: Effective uid=501, gid=123, home=/mail/dovecot/example.org/user doveadm(user@example.org): Debug: Quota root: name=User quota backend=dict args=:proxy::quota doveadm(user@example.org): Debug: Quota rule: root=User quota mailbox=* bytes=2097152000 messages=0 doveadm(user@example.org): Debug: Quota rule: root=User quota mailbox=Trash bytes=+104857600 messages=0 doveadm(user@example.org): Debug: Quota warning: bytes=1992294400 (95%) messages=0 reverse=no command=quota-warning 95 user@example.org doveadm(user@example.org): Debug: Quota warning: bytes=1677721600 (80%) messages=0 reverse=no command=quota-warning 80 user@example.org doveadm(user@example.org): Debug: dict quota: user=user@example.org, uri=proxy::quota, noenforcing=0 doveadm(user@example.org): Debug: fs: root=/mail/dovecot/example.org/user/mail, index=, control=, inbox=, alt= doveadm(user@example.org): Debug: Namespace : Using permissions from /mail/dovecot/example.org/user/mail: mode=0700 gid=-1 dsync(user@example.org): Debug: Effective uid=501, gid=123, home=/mail/dovecot/example.org/user dsync(user@example.org): Debug: Quota root: name=User quota backend=dict args=:proxy::quota dsync(user@example.org): Debug: Quota rule: root=User quota mailbox=* bytes=2097152000 messages=0 dsync(user@example.org): Debug: Quota rule: root=User quota mailbox=Trash bytes=+104857600 messages=0 dsync(user@example.org): Debug: Quota warning: bytes=1992294400 (95%) messages=0 reverse=no command=quota-warning 95 user@example.org dsync(user@example.org): Debug: Quota warning: bytes=1677721600 (80%) messages=0 reverse=no command=quota-warning 80 user@example.org dsync(user@example.org): Debug: dict quota: user=user@example.org, uri=proxy::quota, noenforcing=0 dsync(user@example.org): Debug: imapc: root=, index=, control=, inbox=, alt= dsync(user@example.org): Debug: imapc(local-mailbox:18143): Looking up IP address dsync(user@example.org): Debug: imapc(local-mailbox:18143): Connecting to 10.129.3.196:18143 dsync(user@example.org): Debug: imapc(local-mailbox:18143): Server capabilities: IMAP4 IMAP4rev1 AUTH=LOGIN ACL NAMESPACE CHILDREN SORT QUOTA THREAD=ORDEREDSUBJECT UNSELECT IDLE dsync(user@example.org): Debug: imapc(local-mailbox:18143): Authenticating as user@example.org dsync(user@example.org): Debug: imapc(local-mailbox:18143): Authenticated successfully dsync(user@example.org): Error: Can't delete mailbox INBOX: INBOX can't be deleted. dsync(user@example.org): Debug: Namespace : /mail/dovecot/example.org/user/mail/mailboxes/Trash doesn't exist yet, using default permissions dsync(user@example.org): Debug: Namespace : Using permissions from /mail/dovecot/example.org/user/mail: mode=0700 gid=-1 dsync(user@example.org): Debug: Namespace : /mail/dovecot/example.org/user/mail/mailboxes/Sent doesn't exist yet, using default permissions dsync(user@example.org): Debug: Namespace : Using permissions from /mail/dovecot/example.org/user/mail: mode=0700 gid=-1 dsync(user@example.org): Info: INBOX: only in dest (guid=54c23c119d04eb4f005100004f99b03d) dsync(user@example.org): Info: Trash: only in source (guid=7f5af7ba291b2df1a11d573bdb55d7e9) dsync(user@example.org): Info: Sent: only in source (guid=bfb2e03fdce327671e82bf173b1ccb8b) dsync(user@example.org): Info: INBOX: only in source (guid=c92f64f79f0d1ed01e6d5b314f04886c) dsync(user@example.org): Error: Trying to open a non-listed mailbox with guid=54c23c119d04eb4f005100004f99b03d dsync(user@example.org): Error: msg iteration failed: Couldn't open mailbox 54c23c119d04eb4f005100004f99b03d dsync(user@example.org): Error: Trying to open a non-listed mailbox with guid=54c23c119d04eb4f005100004f99b03d dsync(user@example.org): Error: Mailbox INBOX changed its GUID (c92f64f79f0d1ed01e6d5b314f04886c -> 54c23c119d04eb4f005100004f99b03d) dsync(user@example.org): Error: msg iteration failed: Couldn't open mailbox c92f64f79f0d1ed01e6d5b314f04886c dsync(user@example.org): Error: Mailbox INBOX changed its GUID (c92f64f79f0d1ed01e6d5b314f04886c -> 54c23c119d04eb4f005100004f99b03d) dsync(user@example.org): Debug: imapc(local-mailbox:18143): Disconnected
is this an intented behaviour or is this a bug in quota recalc? if i delete the home directory again after the quota recalc recreated it no errors are reported and the mail are all copied as intended.
Kind regards Reinhard
On Wed, 2012-06-27 at 15:10 +0200, Reinhard Vicinus wrote:
Hi,
if i delete the home directory and all content below an existing account user@example.org. Then run:
/usr/bin/doveadm quota recalc -u user@example.org
Are you sure quota recalc makes a difference here? What if you simply run doveadm twice?
and afterwards:
/usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -D -v backup -R -f -u user@example.org imapc:
dsync(user@example.org): Error: Mailbox INBOX changed its GUID (c92f64f79f0d1ed01e6d5b314f04886c -> 54c23c119d04eb4f005100004f99b03d) dsync(user@example.org): Error: msg iteration failed: Couldn't open mailbox c92f64f79f0d1ed01e6d5b314f04886c
Bug/"feature" .. you could try if running with "imapc:/tmp/imapc-username" instead of "imapc:" helps.
On 28/06/12 08:53, Timo Sirainen wrote:
On Wed, 2012-06-27 at 15:10 +0200, Reinhard Vicinus wrote:
Hi,
if i delete the home directory and all content below an existing account user@example.org. Then run:
/usr/bin/doveadm quota recalc -u user@example.org Are you sure quota recalc makes a difference here? What if you simply run doveadm twice? Running doveadm twice without quota recalc prior works without problems. and afterwards:
/usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -D -v backup -R -f -u user@example.org imapc:
dsync(user@example.org): Error: Mailbox INBOX changed its GUID (c92f64f79f0d1ed01e6d5b314f04886c -> 54c23c119d04eb4f005100004f99b03d) dsync(user@example.org): Error: msg iteration failed: Couldn't open mailbox c92f64f79f0d1ed01e6d5b314f04886c Bug/"feature" .. you could try if running with "imapc:/tmp/imapc-username" instead of "imapc:" helps. This works also without problems. So thanks for your help because this solves my problem. Let me know if i should test something more.
On 28/06/12 09:03, Reinhard Vicinus wrote:
and afterwards:
/usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -D -v backup -R -f -u user@example.org imapc:
dsync(user@example.org): Error: Mailbox INBOX changed its GUID (c92f64f79f0d1ed01e6d5b314f04886c -> 54c23c119d04eb4f005100004f99b03d) dsync(user@example.org): Error: msg iteration failed: Couldn't open mailbox c92f64f79f0d1ed01e6d5b314f04886c Bug/"feature" .. you could try if running with "imapc:/tmp/imapc-username" instead of "imapc:" helps. This works also without problems. So thanks for your help because this solves my problem. Let me know if i should test something more.
Sorry, I either made a mistake in my test setup or i can't reproduce it, but adding imapc:/tmp/imapc-username instead of imapc: doesn't help. I have circumvented my problem by changing the quota values directly in the database in my migration process.
But there is the following difference between using imapc:/tmp/imapc-username and plain imapc: if i backup a single, on both servers empty mailbox with different guids from the non dovecot imap server to the dovecot imap server, then plain imapc: throws some errors but works, imapc:/tmp/imapc-username throws more errors and only deletes the mailbox on the destination.
Test setup is as follow:
Both accounts don't contain a mailbox Test1: /usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mail=imapc: mailbox status -u user@example.org all Test1 <empty reply> /usr/bin/doveadm mailbox status -u user@example.org all Test1 <empty reply>
Create Mailbox Test1 on the imapc server: /usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mail=imapc: mailbox create -u user@example.org Test1 <empty reply>
Create Mailbox Test1 on the dovecot server: doveadm mailbox create -u user@example.org Test1 <empty reply>
List the status of mailbox Test1 on the imapc server: /usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mail=imapc: mailbox status -u user@example.org all Test1 Test1 messages=0 recent=0 uidnext=0 uidvalidity=87991 unseen=0 highestmodseq=0 vsize=0 guid=0f6e69ad71659995677b43f8a8312025
List the status of mailbox Test1 on the dovecot server: /usr/bin/doveadm mailbox status -u user@example.org Test1 Test1 messages=0 recent=0 uidnext=1 uidvalidity=1340879819 unseen=0 highestmodseq=1 vsize=0 guid=a8076214cb33ec4f396700004f99b03d
Start Backup with imapc:/tmp/user: /usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 backup -R -f -u user@example.org -m Test1 imapc:/tmp/user dsync(user@example.org): Error: Failed to sync mailbox Test1: Mailbox doesn't exist: Test1 dsync(user@example.org): Error: msg iteration failed: Couldn't open mailbox 0f6e69ad71659995677b43f8a8312025 dsync(user@example.org): Error: Failed to sync mailbox Test1: Mailbox doesn't exist: Test1 dsync(user@example.org): Error: Trying to open a non-listed mailbox with guid=a8076214cb33ec4f396700004f99b03d dsync(user@example.org): Error: msg iteration failed: Couldn't open mailbox a8076214cb33ec4f396700004f99b03d dsync(user@example.org): Error: Trying to open a non-listed mailbox with guid=a8076214cb33ec4f396700004f99b03d
List the status of mailbox Test1 on the imapc server: /usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mail=imapc: mailbox status -u user@example.org all Test1 Test1 messages=0 recent=0 uidnext=0 uidvalidity=87991 unseen=0 highestmodseq=0 vsize=0 guid=0f6e69ad71659995677b43f8a8312025
List the status of mailbox Test1 on the dovecot server: /usr/bin/doveadm mailbox status -u user@example.org all Test1 <empty reply>
result: the mailbox Test1 on the dovecot server got deleted.
with plain imapc: copying works but there are also still error messages:
Create Mailbox Test2 on the imapc server: /usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mail=imapc: mailbox create -u user@example.org Test2 <empty reply>
Create Mailbox Test2 on the dovecot server: doveadm mailbox create -u user@example.org Test2 <empty reply>
List the status of mailbox Test2 on the imapc server: /usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mail=imapc: mailbox status -u user@example.org all Test2 Test2 messages=0 recent=0 uidnext=0 uidvalidity=87993 unseen=0 highestmodseq=0 vsize=0 guid=c0fd4ba8bd514c5c43ab9a897c8c014e
List the status of mailbox Test2 on the dovecot server: /usr/bin/doveadm mailbox status -u user@example.org Test2 Test2 messages=0 recent=0 uidnext=1 uidvalidity=1340879820 unseen=0 highestmodseq=1 vsize=0 guid=a19eee292435ec4f676a00004f99b03d
Start Backup with imapc: /usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 backup -R -f -u user@example.org -m Test2 imapc: dsync(user@example.org): Error: Trying to open a non-listed mailbox with guid=a19eee292435ec4f676a00004f99b03d dsync(user@example.org): Error: msg iteration failed: Couldn't open mailbox a19eee292435ec4f676a00004f99b03d dsync(user@example.org): Error: Trying to open a non-listed mailbox with guid=a19eee292435ec4f676a00004f99b03d
List the status of mailbox Test2 on the imapc server: /usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mail=imapc: mailbox status -u user@example.org all Test2 Test2 messages=0 recent=0 uidnext=0 uidvalidity=87993 unseen=0 highestmodseq=0 vsize=0 guid=c0fd4ba8bd514c5c43ab9a897c8c014e
List the status of mailbox Test2 on the dovecot server: /usr/bin/doveadm mailbox status -u user@example.org Test2 Test2 messages=0 recent=0 uidnext=1 uidvalidity=87993 unseen=0 highestmodseq=1 vsize=0 guid=c0fd4ba8bd514c5c43ab9a897c8c014e
If instead of a normal Mailbox the special mailbox INBOX is used there are still more errors and both ways don't work. I think because backup isn't able to delete the mailbox INBOX on the destination site.
So i'll make sure that when i migrate an account the mail destination is really empty.
On 24.6.2012, at 18.57, Reinhard Vicinus wrote:
i try to migrate mails from a non dovecot imap server to a dovecot imap server with doveadm backup as described there:
http://wiki2.dovecot.org/Migration/Dsync
i first tried (local-mailbox port 18143 is the non dovecot imap server):
/usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mailbox_list_index=no -v -D backup -R -f -u user@example.org -m Sent imapc:
and got the following error:
dsync(user@example.org): Fatal: dsync backup: Looks like you're trying to run backup in wrong direction. Source is empty and destination is not.
Strange. -R is supposed to make it copy from imapc to mdbox.. Have you tried if Dovecot can see mails at all from the remote server? Try doveadm -o mail=imapc: -o ... fetch instead of doveadm backup command.
As the dovecot imap account is newly created and therefore empty it seams to try to backup from the dovecot imap server to the non dovecot imap server. So i tried instead:
/usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mailbox_list_index=no -v -D backup -f -u user@example.org -m Sent imapc:
Now this is copying from mdbox to imapc, which is also why you're getting the crash:
Sometimes (every other time?) i got the following segmentation fault:
bt #0 0x00007f15e2c9ed74 in strcasecmp () from /lib/libc.so.6 #1 0x00007f15e327eaff in imapc_save_callback (reply=0x7fff56096a70, context=<value optimized out>) at imapc-save.c:168
Note how it's saving a mail to imapc. But still, that's a bug, fixed: http://hg.dovecot.org/dovecot-2.1/rev/20703dbd1168
dsync(user@example.org): Warning: Destination mailbox Sent has been modified, need to recreate it before we can continue syncing
I think this is also because it's going to wrong direction.
i think the problem could be that the account name on the remote server and the local server is absolute identical and doveadm backup has therefore problems discerning between the two locations. But that's only a stab in the dark and any help is appreciated.
Shouldn't be a problem.
On 25/06/12 18:46, Timo Sirainen wrote:
On 24.6.2012, at 18.57, Reinhard Vicinus wrote:
i try to migrate mails from a non dovecot imap server to a dovecot imap server with doveadm backup as described there:
http://wiki2.dovecot.org/Migration/Dsync
i first tried (local-mailbox port 18143 is the non dovecot imap server):
/usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mailbox_list_index=no -v -D backup -R -f -u user@example.org -m Sent imapc:
and got the following error:
dsync(user@example.org): Fatal: dsync backup: Looks like you're trying to run backup in wrong direction. Source is empty and destination is not. Strange. -R is supposed to make it copy from imapc to mdbox.. Have you tried if Dovecot can see mails at all from the remote server? Try doveadm -o mail=imapc: -o ... fetch instead of doveadm backup command. You're right it was an error in my setup that caused this problem. After fixing that problem it now works as expected. The only thing I don't get working is running it via the doveadm-server socket with:
/usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mailbox_list_index=no -v -D backup -S /var/run/dovecot-director/doveadm-server -R -u user@example.org imapc:
In the logfile on the server there is the following error message:
Jun 25 20:01:26 10.129.3.200 dovecot: dsync(user@example.org): Error: user user@example.org: Initialization failed: Initializing mail storage from mail_location setting failed: imapc: missing imapc_host Jun 25 20:01:26 10.129.3.200 dovecot: dsync(user@example.org): Fatal: User init failed
So I think that all the -o configurations aren't transfered via the doveadm-server socket.
As the dovecot imap account is newly created and therefore empty it seams to try to backup from the dovecot imap server to the non dovecot imap server. So i tried instead:
/usr/bin/doveadm -o imapc_user=user@example.org -o imapc_password=imappw -o imapc_host=local-mailbox -o imapc_features=rfc822.size -o imapc_port=18143 -o mailbox_list_index=no -v -D backup -f -u user@example.org -m Sent imapc: Now this is copying from mdbox to imapc, which is also why you're getting the crash:
Sometimes (every other time?) i got the following segmentation fault:
bt #0 0x00007f15e2c9ed74 in strcasecmp () from /lib/libc.so.6 #1 0x00007f15e327eaff in imapc_save_callback (reply=0x7fff56096a70, context=<value optimized out>) at imapc-save.c:168 Note how it's saving a mail to imapc. But still, that's a bug, fixed: http://hg.dovecot.org/dovecot-2.1/rev/20703dbd1168
dsync(user@example.org): Warning: Destination mailbox Sent has been modified, need to recreate it before we can continue syncing I think this is also because it's going to wrong direction. Yes, the problem there was that it was the wrong direction.
On 25.6.2012, at 21.21, Reinhard Vicinus wrote:
Jun 25 20:01:26 10.129.3.200 dovecot: dsync(user@example.org): Error: user user@example.org: Initialization failed: Initializing mail storage from mail_location setting failed: imapc: missing imapc_host Jun 25 20:01:26 10.129.3.200 dovecot: dsync(user@example.org): Fatal: User init failed
So I think that all the -o configurations aren't transfered via the doveadm-server socket.
Correct. None of them are, and that's by design.
participants (3)
-
Charles Marcus
-
Reinhard Vicinus
-
Timo Sirainen