README_Windows.txt 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. # $Id: README_Windows.txt,v 1.27 2022/04/05 19:45:21 gilles Exp gilles $
  2. #
  3. # This is the README_Windows.txt file for imapsync
  4. # imapsync: IMAP syncing and migration tool.
  5. =====================
  6. Imapsync on Windows
  7. =====================
  8. There are two ways to install and use imapsync on Windows systems: A) or B).
  9. Standard users should take the A) way, the simplest way.
  10. Developers, or power users that want to build their own imapsync.exe
  11. or modify it, have to consider the B) way, the complex and powerful way.
  12. ---------------
  13. A) Simplest way
  14. ---------------
  15. A.0) Preamble for visual users looking for a visual tool.
  16. First, the visual thing I am talking about here is not the online
  17. visual interface I call /X that you might have seen and used at the
  18. URL https://imapsync.lamiral.info/X/
  19. This /X visual interface is not yet available on Windows as a service
  20. that you can install and use in your system. I plan to make a visual
  21. tool available on Windows but, for now, I encountered technical
  22. issues.
  23. So what visual thing am I talking about?
  24. Imapsync itself is not a visual tool. The visual tool is Notepad or
  25. any text editor. Many pure visual users have succeeded in using
  26. imapsync to transfer their email accounts. As you can guess, only the
  27. ones that tried have succeeded, so don't give up before trying at
  28. least once. Another assumption is that visual users can read.
  29. Let's go for some reading!
  30. A.1) Get imapsync.
  31. Get imapsync at https://imapsync.lamiral.info/
  32. You'll then have access to a zip archive file named imapsync_2.200.zip
  33. where 2.200 is the imapsync release number.
  34. A.2) Extract the zip file in a folder where you will work with imapsync.
  35. You can work on the Desktop since the zip file extraction creates
  36. a unique folder named imapsync_2.200/
  37. Do not unzip the archive in what is called a "system" directory since
  38. you may encounter permission issues.
  39. Two points to have in mind:
  40. * You don't need to be an Administrator to unzip the zip archive.
  41. * You don't need to be an Administrator to run imapsync.
  42. In short, any user on your system can use imapsync.
  43. A.3) Check the folder
  44. In the folder extracted and called imapsync_2.200, you see 7 files
  45. and 2 directories. Those files and directories may be presented in a
  46. different order than the following, the order is not important
  47. anyway. There are only two important files to get your mailbox
  48. transfer job started in a few minutes, the first two files of the
  49. following list:
  50. * README_Windows.txt is the current file you are reading.
  51. * imapsync_example.bat is a simple batch file example that you will copy and edit.
  52. * README.txt is the imapsync general document.
  53. * FAQ.d/* FAQs are a good read when something goes wrong.
  54. * sync_loop_windows.bat is a batch file example for syncing many accounts.
  55. * file.txt is an input file example for syncing many accounts.
  56. * imapsync.exe is the imapsync 64bit binary. You don't have to run it directly.
  57. * imapsync_32bit.exe is the imapsync 32bit binary. You don't have to run it directly.
  58. * Cook/ is the directory to build imapsync.exe from its source,
  59. for the B) way and expert users.
  60. You can copy or rename the file imapsync_example.bat as you wish,
  61. as long as its extension remains ".bat", for example, mysync.bat
  62. On Windows systems, a file name ending with a .bat extension means
  63. "I'm a batch script". A batch script is a file containing commands,
  64. it's a program. Don't be afraid, a program can be very simple to
  65. modify and I hope imapsync_example.bat is one of them.
  66. The batch scripts have to stay in the same directory as imapsync.exe
  67. because of the way they call imapsync.exe. They use the string
  68. ".\imapsync.exe", so let them be in the same directory.
  69. You can change the path .\ to whatever you want if you understand
  70. what you are doing (you have to use a pathname from the script point
  71. of view).
  72. For the rest of this documentation, I assume you copied
  73. imapsync_example.bat to a file named mysync.bat
  74. If you don't know how to copy and rename a file then use
  75. imapsync_example.bat itself, it's ok. The original file is still in
  76. the zip file in case you want to restart from scratch.
  77. A.4) Edit the batch file
  78. This section describes how to edit the file mysync.bat and change
  79. it by replacing example values with your values.
  80. To edit mysync.bat, you have to right-click on it and select "modify"
  81. in the list presented in the small window menu.
  82. Notepad or Notepadd++ are very good editor candidates to modify the
  83. script. Notepad is already installed on any Windows system,
  84. Notepadd++ is not usually installed but if you have it, then use it.
  85. Office Word or any powerful text processor is NOT good for that job.
  86. Text processors transform files in a special format that is wrong to
  87. make them stay a good batch file, so don't use them!
  88. The documents FAQ.txt and FAQ.d/* contain many tips. They describe
  89. some special options that are sometimes needed by specific imap
  90. software servers like Exchange, Office365, or Gmail.
  91. Those documents are also available online at
  92. https://imapsync.lamiral.info/FAQ.d/
  93. You don't have to look into them unless you encounter problems.
  94. A.5) Run the batch file
  95. To run imapsync with your values just double-click on the batch file
  96. mysync.bat
  97. There is no need to have administrator privileges to run imapsync.
  98. The run happens in a DOS window; usually, this window is black.
  99. If imapsync.exe returns immediately with the ERRORLEVEL -1, it may be
  100. because you have a Group Policy in place to prevent the execution of
  101. programs in the %TEMP% directory. Temporarily remove this restriction
  102. and imapsync will work as expected. Thanks to Walter H. for this
  103. input!
  104. Technically speaking, imapsync.exe is an embedded Perl script with
  105. also the Perl interpreter and many Perl modules, all glued together
  106. in an archive auto-extracted at run time. So it needs write-access to
  107. the temporary directory. The temporary directory name depends on the
  108. user but its value is in the variable %TEMP%. You can have the value
  109. by running the command ECHO %TEMP% in a DOS window. You can have a
  110. DOS window by launching the command cmd.exe
  111. A.6) Look at the sync running.
  112. You can abort the sync at any time with a quick double ctrl-c, hit
  113. ctrl-c twice within one second.
  114. A single ctrl-c will reconnect to both imap servers.
  115. You can also simply abort the sync by closing the DOS window, using
  116. the cross situated at the up-right corner.
  117. What you see in this DOS terminal is also put in a logfile located
  118. in the subdirectory LOG_imapsync/
  119. A.7) Control what happened.
  120. When the sync is finished you can find the whole log file of the
  121. output in the folder named "LOG_imapsync/".
  122. The logfile name is based on the launching date, hour, minute,
  123. second, milliseconds, plus the user1 and user2 parameters.
  124. For example, a file name can be
  125. LOG_imapsync\2019_11_29_14_49_36_514_tata_titi.txt
  126. There is one log file created for each run. The log file name is
  127. printed both at the beginning and the end of the imapsync run.
  128. IMPORTANT: When there is a problem, the problem is very often
  129. described at the end of the log file. It means you don't have to read
  130. all this bloody ununderstandable verbose logfile, just read the end
  131. first.
  132. A.8) Loop on A.4 through A.7
  133. * A.4) edit the batch file
  134. * A.5) run the batch file
  135. * A.6) look at the run and the log file
  136. * A.7) control what happened.
  137. Loop on the process of editing, running and controlling imapsync
  138. until you solve all issues and the sync is over.
  139. A good sign that the sync went very well is when the nearly last lines are like:
  140. " The sync looks good, all 123456 identified messages in host1 are on host2.
  141. " There is no unidentified message
  142. " Detected 0 errors
  143. Congratulations!
  144. ------------
  145. B) Hard way
  146. ------------
  147. It is the hard way because it installs all software dependencies.
  148. This is the way for modifying imapsync.exe if needed.
  149. B.1) Install Perl if it isn't already installed.
  150. Strawberry Perl is a very good candidate
  151. http://strawberryperl.com/
  152. I use 5.32.1.1 (released 2021-01-24) but previous and later releases
  153. should work as well (Perl 5.18 to 5.30 do).
  154. B.2) Go into the Cook/ directory
  155. B.3) Double-click build_exe.bat
  156. It should create a binary imapsync.exe in the current Cook/ directory.
  157. B.4) Move imapsync.exe in the upper directory and follow instructions
  158. from A.3) to A.8)