INSTALL.Darwin.txt 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. #!/bin/cat
  2. # $Id: INSTALL.Darwin.txt,v 1.39 2022/05/17 14:31:44 gilles Exp gilles $
  3. This documentation is also located online at
  4. https://imapsync.lamiral.info/INSTALL.d/
  5. https://imapsync.lamiral.info/INSTALL.d/INSTALL.Darwin.txt
  6. Usual users should follow the A) section only, with the exeption
  7. of reading B) before if you use a Catalina system.
  8. A) Installing imapsync binary on Darwin / Mac OS X
  9. B) Installing imapsync on Catalina
  10. C) Installing imapsync script on Darwin / Mac OS X with brew
  11. D) Installing imapsync script on Darwin / Mac OS X the way I do
  12. E) Building imapsync binary on Darwin / Mac OS X
  13. =======================================================================
  14. A) Installing imapsync binary on Darwin / Mac OS X
  15. =======================================================================
  16. There is a standalone imapsync binary for Mac OS X
  17. called "imapsync_bin_Darwin" (without the quotes),
  18. available in the compressed tarball called imapsync-2.200.tgz
  19. where 2.200 is the imapsync version number.
  20. In case you haven't buy it yet or forgot where the download link is,
  21. check https://imapsync.lamiral.info/dist/
  22. Download the tarball imapsync-2.200.tgz, not the binary imapsync_bin_Darwin
  23. because the binary is also in the tarball and there are other useful files
  24. in the tarball. The binary present in /dist/ is just there for a fast upgrade
  25. when you need one.
  26. I suppose this tarball imapsync-2.200.tgz is downloaded under your $HOME directory,
  27. let say /Users/gilles/, but you can put it anywhere. In real, your $HOME directory
  28. is not /Users/gilles/, it maybe /Users/john/ or /Users/zoey/ where John or Zoey
  29. is you login name.
  30. Open a terminal: /Applications/Utilities/Terminal double-click on Terminal.
  31. Untar the tarball:
  32. cd
  33. pwd
  34. tar xzvf imapsync-2.200.tgz
  35. In case the previous command fails, it means the tarball file called imapsync-2.200.tgz
  36. is not in your $HOME directory, you may have downloaded it elsewhere on the file system.
  37. A way to find it is the command:
  38. find / | grep imapsync
  39. Now that the tarball is extracted, it created a directory called imapsync-2.200/
  40. Go into the directory imapsync-2.200 with the command:
  41. cd imapsync-2.200
  42. First let's have a simple run to see if imapsync_bin_Darwin works.
  43. You should see some help about options and an example at the end
  44. of this run:
  45. ./imapsync_bin_Darwin
  46. To go further, perform a complete test with two
  47. real IMAP server accounts:
  48. ./imapsync_bin_Darwin --testslive
  49. If this sync works fine then imapsync_bin_Darwin is ready for any
  50. imap account synchronization.
  51. When reading the documentation with imapsync command lines examples,
  52. you have to replace the command "imapsync" by "imapsync_bin_Darwin"
  53. For example, instead of the command:
  54. ./imapsync \
  55. --host1 test1.lamiral.info --user1 test1 --password1 secret1 \
  56. --host2 test2.lamiral.info --user2 test2 --password2 secret2
  57. you have to use:
  58. ./imapsync_bin_Darwin \
  59. --host1 test1.lamiral.info --user1 test1 --password1 secret1 \
  60. --host2 test2.lamiral.info --user2 test2 --password2 secret2
  61. The script examples/imapsync_example_darwin.sh is ready to use,
  62. it is a copy of examples/imapsync_example.sh adapted to Mac users.
  63. Be careful the way you edit the script files, use a text editor.
  64. Do not use a word processor because word processors add
  65. or use special formating characters that will break the shell
  66. scripts. If you use TextEdit, use the text mode.
  67. In the terminal, try:
  68. sh examples/imapsync_example_darwin.sh
  69. or copy it and run your copy instead:
  70. cp examples/imapsync_example_darwin.sh mysync.sh
  71. sh mysync.sh
  72. Now read on the tutorial
  73. https://imapsync.lamiral.info/doc/TUTORIAL_Unix.html
  74. in order to complete your formation on imapsync.
  75. If you need to sync or migrate many accounts,
  76. the script examples/sync_loop_darwin.sh is also ready to use.
  77. =======================================================================
  78. B) Installing imapsync on Catalina
  79. =======================================================================
  80. Caveat Catalina: The binary imapsync_bin_Darwin is detected as a malware
  81. or similar on the latest Mac OS X named Catalina.
  82. It's Catalina new security policy. Imapsync is not a malware or similar.
  83. All other Mac OS X releases are ok.
  84. In order to pass away this detection, follow these steps:
  85. Run imapsync_bin_Darwin
  86. After this first launch, the security asks to authorize the unknown
  87. developer program. Setup the root of the imapsync_bin_Darwin file
  88. and then run it again or any of the .sh files, it should run ok
  89. without any notice any more.
  90. Sources of this tip:
  91. https://www.quora.com/What-does-Can-t-be-opened-because-it-s-integrity-cannot-be-verified-mean-on-OSX-Catalina
  92. https://github.com/fastlane/fastlane/issues/15186#issuecomment-532047545
  93. https://github.com/neovim/neovim/issues/11011#issuecomment-531369505
  94. Other way, on the binary: Control + Right Click -> Open
  95. See also the last section of https://support.apple.com/en-us/HT202491
  96. "How to open an app that hasn't been notarized or is from an unidentified developer"
  97. I don't own a Catalina computer so I can't experiment on this nor make
  98. imapsync directly ok with Catalina. You're richer than me :-)
  99. =======================================================================
  100. C) Installing imapsync script on Darwin / Mac OS X with brew
  101. =======================================================================
  102. In case you have brew installed on your system ( see https://brew.sh/ ),
  103. install imapsync with the command:
  104. brew install imapsync
  105. Do a real test with imap server test.lamiral.info:
  106. imapsync --testslive
  107. If you encouter an error like "String.c: loadable library and perl binaries
  108. are mismatched (got handshake key 0xc500080, needed 0xc400080)",
  109. then install imapsync from source with the command:
  110. brew install -s imapsync
  111. Thanks to Alessandro for this tip!
  112. =======================================================================
  113. D) Installing imapsync script on Darwin / Mac OS X the way I do
  114. =======================================================================
  115. This part is only for advanced Unix users, or brave users.
  116. The "make" command is a prerequisite to build some Perl modules.
  117. Install the "make" command in case it is not already installed.
  118. First let us install cpanminus locally in ~/perl5
  119. curl -L https://cpanmin.us | perl - -l ~/perl5 App::cpanminus local::lib
  120. Then take this install into account in the current environment
  121. perl -I ~/perl5/lib/perl5 -Mlocal::lib # just to see the variables
  122. eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib` # doing the variables assigments
  123. If you want to have always this setting in your environment then run the commands
  124. echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.profile
  125. echo 'export MANPATH=$HOME/perl5/man:$MANPATH' >> ~/.profile
  126. cat ~/.profile
  127. . ~/.profile
  128. Now let's update the standard CPAN Perl module
  129. cpanm CPAN
  130. The specific install part for imapsync begins, the script "prerequisites_imapsync"
  131. helps to verify what is needed to install on your system
  132. curl -L http://imapsync.lamiral.info/INSTALL.d/prerequisites_imapsync > prerequisites_imapsync
  133. sh prerequisites_imapsync
  134. cpanm Authen::NTLM
  135. cpanm IO::Tee
  136. cpanm Mail::IMAPClient # File::Copy::Recursive?
  137. cpanm Unicode::String
  138. cpanm Sys::MemInfo
  139. cpanm File::Tail
  140. cpanm Proc::ProcessTable
  141. cpanm Test::MockObject
  142. cpanm Readonly
  143. cpanm Data::Uniqid
  144. cpanm JSON::WebToken
  145. We're ready to install and test the latest imapsync
  146. curl -L http://imapsync.lamiral.info/imapsync > imapsync
  147. chmod +x imapsync
  148. ./imapsync
  149. ./imapsync --testslive
  150. ./imapsync --tests
  151. You can rerun "sh prerequisites_imapsync"
  152. to verify everything is ok:
  153. sh prerequisites_imapsync
  154. When everything is ok the script execution ends with this sentence
  155. "All needed modules are already installed"
  156. =======================================================================
  157. E) Building imapsync binary on Darwin / Mac OS X
  158. =======================================================================
  159. cpanm Module::ScanDeps
  160. cpanm PAR::Packer
  161. pp -x -u -o imapsync.bin imapsync
  162. ./imapsync.bin
  163. ./imapsync.bin --testslive
  164. ./imapsync.bin --tests
  165. ./imapsync.bin --module
  166. =======================================================================
  167. =======================================================================