{"id":3159,"date":"2020-03-27T19:26:17","date_gmt":"2020-03-28T00:26:17","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=3159"},"modified":"2020-03-27T19:27:15","modified_gmt":"2020-03-28T00:27:15","slug":"imapsync-bulk-copy-not-copying-first-account-in-list","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/imapsync-bulk-copy-not-copying-first-account-in-list\/","title":{"rendered":"imapsync bulk copy not copying first account in list"},"content":{"rendered":"\n<p>Ran into an issue where it looked like imapsync would fail to connect to the server on the first line when trying to do a bulk move. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mail.maildomain.com;user1@incredigeek.com;password1;mail.incredigeek.com;user2@incredigeek.com;password2<\/pre>\n\n\n\n<p>Was able to work around the issue by Adding a comment line to the top of the file.  May have to do with how the script I was using handles the lines.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">### Email Import list mail.maildomain.com;user1@incredigeek.com;password1;mail.incredigeek.com;user2@incredigeek.com;password2<\/pre>\n\n\n\n<p>Script used to copy<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#!\/bin\/sh\n# $Id: sync_loop_unix.sh,v 1.6 2015\/11\/04 18:23:04 gilles Exp gilles $ \n#Example for imapsync massive migration on Unix systems.\n#See also http:\/\/imapsync.lamiral.info\/FAQ.d\/FAQ.Massive.txt\n#\nData is supposed to be in file.txt in the following format:\nhost001_1;user001_1;password001_1;host001_2;user001_2;password001_2; \u2026 \n#Separator is character semi-colon \";\" it can be changed by any character changing IFS=';' in the while loop below.\n# Each line contains 6 columns, columns are parameter values for\n--host1 --user1 --password1 --host2 --user2 --password2\nand a trailing empty fake column to avoid CR LF part going\nin the 6th parameter password2. Don't forget the last semicolon.\n# You can add extra options after the variable \"$@\" Use character backslash \\ at the end of each supplementary line, xcept for the last one. You can also pass extra options via the parameters of this script since they will be in \"$@\" The credentials filename \"file.txt\" used for the loop can be renamed by changing \"file.txt\" below. echo Looping on account credentials found in file.txt\necho\nfile=\"${1}\"\n{ while IFS=',' read  h1 u1 p1 h2 u2 p2 fake\n    do \n        { echo \"$h1\" | egrep \"^#\" ; } > \/dev\/null &amp;&amp; continue # this skip commented lines in file.txt\n        echo \"==== Starting imapsync from host1 $h1 user1 $u1 to host2 $h2 user2 $u2 ====\"\n         imapsync --host1 \"$h1\" --user1 \"$u1\" --password1 \"$p1\" \\\n                  --host2 \"$h2\" --user2 \"$u2\" --password2 \"$p2\" \\\n                  \"$@\" --delete2\n         echo \"==== Ended imapsync from host1 $h1 user1 $u1 to host2 $h2 user2 $u2 ====\"\n         echo\n    done \n} &lt; ${file}<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ran into an issue where it looked like imapsync would fail to connect to the server on the first line when trying to do a bulk move. mail.maildomain.com;user1@incredigeek.com;password1;mail.incredigeek.com;user2@incredigeek.com;password2 Was able to work around the issue by Adding a comment line &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/imapsync-bulk-copy-not-copying-first-account-in-list\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[338,224,955],"class_list":["post-3159","post","type-post","status-publish","format-standard","hentry","category-linux","tag-imapsync","tag-mail","tag-migration"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=3159"}],"version-history":[{"count":3,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3159\/revisions"}],"predecessor-version":[{"id":3162,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3159\/revisions\/3162"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=3159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=3159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=3159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}