FAQ.Two_Ways_Sync.txt 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. $Id: FAQ.Two_Ways_Sync.txt,v 1.8 2022/07/25 14:03:49 gilles Exp gilles $
  2. This documentation is also available online at
  3. https://imapsync.lamiral.info/FAQ.d/
  4. https://imapsync.lamiral.info/FAQ.d/FAQ.Two_Ways_Sync.txt
  5. =======================================================================
  6. ================ Two ways sync with Imapsync =========================
  7. =======================================================================
  8. =======================================================================
  9. Q. Can Imapsync do a good "two ways" sync?
  10. Short answer: no, not a good one. Why?
  11. R. Imapsync can't do good two ways syncs.
  12. A good "two ways" sync is impossible with imapsync because imapsync is
  13. stateless.
  14. Each time imapsync runs, it considers messages and folders as if it
  15. were the first time it encounters them. Imapsync looks at messages,
  16. flags, and folders as they are now, not considering what they were
  17. before the current. Imapsync has no memory outside the current running
  18. sync.
  19. So now, why a stateless behavior cannot handle well a two ways sync
  20. between an account A and an account B?
  21. The problem arises with deletions, messages deletions, folders
  22. deletions, or with moves, messages moves across folders, folders
  23. moves, and also folders renamings. Deletions and moves are ambiguous
  24. changes when combined with creations on the opposite side.
  25. For example, if a message is deleted from A by a user, then imapsync
  26. cannot know whether it is a message deleted from A that has to be
  27. deleted in B (what the user actually did) or a missing message on A
  28. that has to be copied from B.
  29. But if you know the answer yourself, that missing messages on one side
  30. A are deleted messages that have to be deleted on the other side then
  31. run a sync with the --delete2 option from A to B. This assumes there
  32. is no new messages on B because --delete2 will delete them.
  33. If you know that the missing messages on A are messages from B
  34. that has to be copied to A, then run a sync from B to A.
  35. If you know it's a mixed scenario, that there are some deletions/moves
  36. on A, and there are some deletions/moves on B, but not the same, then
  37. you are in trouble and it ends up with a not very good "two ways"
  38. sync. In that case, two runs of imapsync, one from A to B, one from B
  39. to A, put the two accounts in a synchronized state. The deletions of
  40. messages on either side get cancelled, deleted messages come back. A
  41. folder renaming on either side brings back the old folder. It's not a
  42. good two ways synchronization.
  43. My suggestion is:
  44. a) Use a single active imap account that fits all your needs,
  45. available from anywhere, at any time. Access it from both your
  46. laptop and your iphone.
  47. b) Feed this active account with foreign and passive accounts with any
  48. tool that can handle the transfer, imapsync being one of them.
  49. c) Have a slave imap backup account of the active one, available also
  50. from anywhere, at any time. Use it only as a failsafe account, when
  51. the active one is broken or to bring back misguidely deleted
  52. messages to the active account. Use any tool that can handle the
  53. synchronization, imapsync being a good one of them.
  54. =======================================================================
  55. Q. What can I do instead of having two ways synchronizations?
  56. R. My suggestion is:
  57. a) Use only one single active imap account that fits all your needs,
  58. available from anywhere, at any time. Access it from all your
  59. devices, laptops, phones, tablets.
  60. b) Feed this active account with foreign and passive accounts with any
  61. tool that can handle the transfer, imapsync being one of them.
  62. c) Have a slave imap backup account of the active one, available also
  63. from anywhere, at any time. Use it only as a failsafe account, when
  64. the active one is broken or to bring back misguidely deleted
  65. messages to the active account. Use any tool that can handle the
  66. synchronization, imapsync being a good one of them.
  67. =======================================================================
  68. Q. What tools can I use to handle two ways synchronizations?
  69. R. There are offlineimap and mbsync/isync tools:
  70. offlineimap is located at http://www.offlineimap.org/
  71. mbsync/isync is located at https://isync.sourceforge.io/
  72. =======================================================================
  73. =======================================================================