imapsync_example.bat 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. @REM $Id: imapsync_example.bat,v 1.12 2022/02/12 11:00:09 gilles Exp gilles $
  2. @REM Here is an imapsync example batch for Windows users.
  3. @REM Lines beginning with @REM are just comments.
  4. @REM Please read the comments, they are written for you, human folk.
  5. @REM Read also https://imapsync.lamiral.info/README_Windows.txt
  6. @REM for more details on how to use imapsync on Windows.
  7. @REM Now let us enter the real work to fit your needs.
  8. @REM Replace below the 6 parameters
  9. @REM "test1.lamiral.info" "test1" "secret1" "test2.lamiral.info" "test2" "secret2"
  10. @REM with your values.
  11. @REM Double quotes are necessary if a value contains one or more blanks.
  12. @REM Value "test1.lamiral.info" for --host1 is the IMAP source server hostname or IP address.
  13. @REM Value "test1" for --user1 is the IMAP source user login.
  14. @REM Value "secret1" for --password1 is the IMAP source user password.
  15. @REM Value "test2.lamiral.info" for --host2 is the IMAP destination server hostname or IP address.
  16. @REM Value "test2" for --user2 is the IMAP destination user login.
  17. @REM Value "secret2" for --password2 is the IMAP destination user password.
  18. @REM Character ^ at the end of the first line is essential and means
  19. @REM "this command continues on the next line". You can add other lines
  20. @REM but don't forget ^ character lasting each line, except the last one.
  21. @REM Also, there must be no other character after each lasting character ^
  22. @REM not even a blank invisible character, or you'll end up with an
  23. @REM error "Unknown command" with what you added.
  24. @REM That is not all, keep on reading!
  25. @REM Three other options are in this example because they are good to start with
  26. @REM
  27. @REM --dry makes imapsync doing nothing, just print what would be done without --dry.
  28. @REM So, if you keep --dry then imapsync will not sync your data.
  29. @REM --justfolders does only folders creations, it ignores messages.
  30. @REM This option is good to verify the folder mapping is good for you
  31. @REM without starting to copy/pollute folders with messages.
  32. @REM
  33. @REM --automap guesses folders mapping, it works for folders like
  34. @REM "Sent", "Junk", "Drafts", "All", "Archive", "Flagged".
  35. @REM
  36. @REM I suggest/impose to start with --automap --justfolders --dry.
  37. @REM If the folder mapping you see in the output is not good then add
  38. @REM some options --f1f2 "folder1=folder2"
  39. @REM to fix the mapping.
  40. @REM Once you are happy with the folder names on the destination,
  41. @REM remove --dry and have a run to create folders on host2.
  42. @REM If everything goes well so far then remove --justfolders to
  43. @REM start syncing messages.
  44. @REM In case you are impatient, just remove --justfolders --dry
  45. @REM in the first place and go. Imapsync is not that bad by default anyway!
  46. .\imapsync.exe --host1 "test1.lamiral.info" --user1 "test1" --password1 "secret1" ^
  47. --host2 "test2.lamiral.info" --user2 "test2" --password2 "secret2" ^
  48. --automap --justfolders --dry
  49. @ECHO The sync is over.
  50. @ECHO Hit any key to close this window
  51. @ECHO the following word "to continue" means in fact "to close this window"
  52. @PAUSE