<div dir="auto"><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><div style="width:361.091px;margin:16px 0px"><div><div><p>Hello,<br><br>I am trying to migrate mailboxes from an old pop/imap server to a new one using Dovecot 2.3.15. The old server uses tpop3d and courier as POP and IMAP servers, respectively.<br><br>Whereas I can migrate IMAP mailboxes without many problems, I am facing difficulties while trying to do the same with POP ones. The problem is that dsync opens simultaneous connections to the remote POP server, so the remote mailbox gets locked and dsync can not copy the messages.<br><br>This is the command I am using to migrate POP mailboxes:<br><br># doveadm -Dv -c dovecot-migration.conf -o pop3c_password="*******" backup -R -u <a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a> pop3c:<br><br>And these are some interesting lines from the output of the above command:<br><br></p><pre style="white-space:pre-wrap">Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: pop3c(10.0.0.104): Looking up IP address
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: pop3c(10.0.0.104): Connecting to <a href="http://10.0.0.104:110/" style="text-decoration-line:none;color:rgb(66,133,244)">10.0.0.104:110</a>
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: pop3c(10.0.0.104): Authenticating as '<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>' (with USER+PASS)
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: Mailbox INBOX: Adding field pop3.uidl to cache for the first time (uid=1)
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: Mailbox INBOX: UID 1: Opened mail because: virtual size (Cache file is unusable)
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: quota: quota_over_flag check: STORAGE ret=3value=3 limit=104857600
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: quota: quota_over_flag check: MESSAGE ret=4value=1 limit=0
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: quota: quota_over_flag=0((null)) vs currently overquota=0
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: brain M: Locking done locally in /var/mail/<a href="http://testemail.domain.com/test2/.dovecot-sync.lock" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2/.dovecot-sync.lock</a> (local hostname=<a href="http://tremedal.domain.com/" style="text-decoration-line:none;color:rgb(66,133,244)">tremedal.domain.com</a>, remote hostname=<a href="http://tremedal.domain.com/" style="text-decoration-line:none;color:rgb(66,133,244)">tremedal.domain.com</a>)
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: brain S: Namespace has location pop3c:
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: pop3c(10.0.0.104): Looking up IP address
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: pop3c(10.0.0.104): Connecting to <a href="http://10.0.0.104:110/" style="text-decoration-line:none;color:rgb(66,133,244)">10.0.0.104:110</a>
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: pop3c(10.0.0.104): Authenticating as '<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>' (with USER+PASS)
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: Mailbox INBOX: Adding field pop3.uidl to cache for the first time (uid=1)
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: brain S: Local mailbox tree: INBOX guid=c92f64f79f0d1ed01e6d5b314f04886c uid_validity=1628081654 uid_next=2 subs=no last_change=0 last_subs=0
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: brain M: Remote mailbox tree: INBOX guid=c92f64f79f0d1ed01e6d5b314f04886c uid_validity=1628081654 uid_next=2 subs=no last_change=0 last_subs=0
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: brain M: Mailbox INBOX: local=00000000000000000000000000000000/0/0, remote=c92f64f79f0d1ed01e6d5b314f04886c/0/1: mailbox not selectable yet
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: Namespace : /var/mail/<a href="http://testemail.domain.com/test2/Mailbox/inbox" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2/Mailbox/inbox</a> doesn't exist yet, using default permissions
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: Namespace : Using permissions from /var/mail/<a href="http://testemail.domain.com/test2/Mailbox" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2/Mailbox</a>: mode=0700 gid=default
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: Namespace : /var/mail/<a href="http://testemail.domain.com/test2/Mailbox/inbox" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2/Mailbox/inbox</a> doesn't exist yet, using default permissions
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: Namespace : Using permissions from /var/mail/<a href="http://testemail.domain.com/test2/Mailbox" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2/Mailbox</a>: mode=0700 gid=default
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: brain S: Mailbox INBOX: local=c92f64f79f0d1ed01e6d5b314f04886c/0/1, remote=00000000000000000000000000000000/0/0: mailbox not selectable yet
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: pop3c(10.0.0.104): Looking up IP address
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: pop3c(10.0.0.104): Connecting to <a href="http://10.0.0.104:110/" style="text-decoration-line:none;color:rgb(66,133,244)">10.0.0.104:110</a>
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: pop3c(10.0.0.104): Authenticating as '<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>' (with USER+PASS)
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: Mailbox INBOX: Adding field pop3.uidl to cache for the first time (uid=1)
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: doveadm-sieve: Iterating Sieve mailbox attributes
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: sieve: Pigeonhole version 0.5.15 (e6a84e31) initializing
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: sieve: include: sieve_global is not set; it is currently not possible to include `:global' scripts.
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: sieve: file storage: Storage path `/var/mail/<a href="http://testemail.domain.com/test2/sieve" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2/sieve</a>' not found
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: sieve: file storage: Using active Sieve script path: /var/mail/<a href="http://testemail.domain.com/test2/.dovecot.sieve" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2/.dovecot.sieve</a>
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: sieve: file storage: Using script storage path: /var/mail/<a href="http://testemail.domain.com/test2/sieve" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2/sieve</a>
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: sieve: file storage: Using permissions from defaults: mode=0700 gid=-1
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: sieve: file storage: Created storage directory /var/mail/<a href="http://testemail.domain.com/test2/sieve/tmp" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2/sieve/tmp</a>
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: sieve: file storage: Relative path to sieve storage in active link: sieve/
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: sieve: file storage: sync: Synchronization active
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: brain M: Import INBOX: Last common UID=0. Delayed expunges=
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: brain M: Import INBOX: Import change type=save GUID=1a82a18794d50d5de2b3f0faa8a6e27c UID=1 hdr_hash= result=Mail's UID is above local UIDNEXT - No more local mails found
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: Mailbox INBOX: UID 1: Opened mail because: mail stream
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: Mailbox INBOX: Adding field size.virtual to cache for the first time (uid=1)
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: Mailbox INBOX: Adding field size.physical to cache for the first time (uid=1)
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: Mailbox POP3-MIGRATION-NS/INBOX: Mailbox opened because: pop3_migration
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: pop3c(10.0.0.104): Looking up IP address
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: pop3c(10.0.0.104): Connecting to <a href="http://10.0.0.104:110/" style="text-decoration-line:none;color:rgb(66,133,244)">10.0.0.104:110</a>
Aug 04 14:54:14 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Debug: pop3c(10.0.0.104): Authenticating as '<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>' (with USER+PASS)
Aug 04 14:54:22 dsync(<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>): Error: pop3_migration: Couldn't sync mailbox POP3-MIGRATION-NS/INBOX: Unable to open mailbox; it may be locked by another concurrent session.</pre><p>In the remote server I get these lines from the tpop3d log:</p><p>Aug 4 14:54:14 lmail1 tpop3d[1887]: authcontext_new_user_pass: began session for `<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>' with mysql; uid 30018, gid 8<br></p><pre style="white-space:pre-wrap">Aug 4 14:54:14 lmail1 tpop3d[1887]: fork_child: [<a href="mailto:6]test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">6]test2@testemail.domain.com</a>(10.0.0.105): successfully authenticated with mysql
Aug 4 14:54:14 lmail1 tpop3d[2270]: mailspool_new_from_file: indexed mailspool /var/spool/mail/<a href="http://testemail.domain.com/test2" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2</a> (2831 bytes) in 0.000s
Aug 4 14:54:14 lmail1 tpop3d[2270]: connections_post_select: connection_read: client [<a href="mailto:6]test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">6]test2@testemail.domain.com</a>(10.0.0.105): closed connection
Aug 4 14:54:14 lmail1 tpop3d[2270]: authcontext_delete: finished session for `<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>' with mysql
Aug 4 14:54:14 lmail1 tpop3d[1887]: authcontext_new_user_pass: began session for `<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>' with mysql; uid 30018, gid 8
Aug 4 14:54:14 lmail1 tpop3d[1887]: fork_child: [<a href="mailto:5]test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">5]test2@testemail.domain.com</a>(10.0.0.105): successfully authenticated with mysql
Aug 4 14:54:14 lmail1 tpop3d[2272]: mailspool_new_from_file: indexed mailspool /var/spool/mail/<a href="http://testemail.domain.com/test2" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2</a> (2831 bytes) in 0.000s
Aug 4 14:54:14 lmail1 tpop3d[2272]: connections_post_select: connection_read: client [<a href="mailto:5]test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">5]test2@testemail.domain.com</a>(10.0.0.105): closed connection
Aug 4 14:54:14 lmail1 tpop3d[2272]: authcontext_delete: finished session for `<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>' with mysql
Aug 4 14:54:14 lmail1 tpop3d[1887]: authcontext_new_user_pass: began session for `<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>' with mysql; uid 30018, gid 8
Aug 4 14:54:14 lmail1 tpop3d[1887]: fork_child: [<a href="mailto:5]test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">5]test2@testemail.domain.com</a>(10.0.0.105): successfully authenticated with mysql
Aug 4 14:54:14 lmail1 tpop3d[2273]: mailspool_new_from_file: indexed mailspool /var/spool/mail/<a href="http://testemail.domain.com/test2" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2</a> (2831 bytes) in 0.000s
Aug 4 14:54:14 lmail1 tpop3d[1887]: authcontext_new_user_pass: began session for `<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>' with mysql; uid 30018, gid 8
Aug 4 14:54:14 lmail1 tpop3d[1887]: fork_child: [<a href="mailto:5]test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">5]test2@testemail.domain.com</a>(10.0.0.105): successfully authenticated with mysql
Aug 4 14:54:22 lmail1 tpop3d[2274]: mailspool_new_from_file: failed to lock /var/spool/mail/<a href="http://testemail.domain.com/test2" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2</a>: Resource temporarily unavailable
Aug 4 14:54:22 lmail1 tpop3d[2274]: dotfile_unlock(/var/spool/mail/<a href="http://testemail.domain.com/test2" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2</a>): lockfile does not have our PID
Aug 4 14:54:22 lmail1 tpop3d[2274]: authcontext_delete: finished session for `<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>' with mysql
Aug 4 14:54:22 lmail1 tpop3d[2273]: connections_post_select: connection_read: client [<a href="mailto:5]test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">5]test2@testemail.domain.com</a>(10.0.0.105): closed connection
Aug 4 14:54:22 lmail1 tpop3d[2273]: authcontext_delete: finished session for `<a href="mailto:test2@testemail.domain.com" style="text-decoration-line:none;color:rgb(66,133,244)">test2@testemail.domain.com</a>' with mysql</pre><p><br>As you can see, in the first five lines the first connection from dsync is opened and closed. Then, the same sequence is repeated again (second connection from dsync). However, on opening the third connection, it is not closed before the fourth one is opened. On authenticating a user, the tpop3d server locks the mailbox to prevent other clients wirting to it. That is why the fourth connection fails as it can not get a lock for the mailbox:<br><br></p><pre style="white-space:pre-wrap">Aug 4 14:54:22 lmail1 tpop3d[2274]: mailspool_new_from_file: failed to lock /var/spool/mail/<a href="http://testemail.domain.com/test2" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2</a>: Resource temporarily unavailable
Aug 4 14:54:22 lmail1 tpop3d[2274]: dotfile_unlock(/var/spool/mail/<a href="http://testemail.domain.com/test2" style="text-decoration-line:none;color:rgb(66,133,244)">testemail.domain.com/test2</a>): lockfile does not have our PID</pre><p><br>Could you please tell me how can I avoid this problem? I wonder why dsync opens so many connections to the remote server, and why it does not close the previous connections before opening new ones.<br><br>Regards,<br></p><pre style="white-space:pre-wrap"></pre></div></div></div><div style="height:0px"></div></div><br></div>