FAQ.Authentication_failure.txt 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #!/bin/cat
  2. $Id: FAQ.Authentication_failure.txt,v 1.16 2022/08/17 09:18:17 gilles Exp gilles $
  3. This documentation is also available online at
  4. https://imapsync.lamiral.info/FAQ.d/
  5. https://imapsync.lamiral.info/FAQ.d/FAQ.Authentication_failure.txt
  6. =======================================================================
  7. Imapsync authentication issues
  8. =======================================================================
  9. Questions answered in this FAQ are:
  10. Q. Imapsync fails with the following error, what can I do?
  11. Host1 failure: Error login on [imap.example.com] with user [foo] auth [LOGIN]: 2 NO [AUTHENTICATIONFAILED] Authentication failed
  12. Q. Imapsync fails with the following error, what can I do?
  13. Host2 failure: Error login on [imap.example.com] with user [foo] auth [LOGIN]: 2 BAD Invalid characters in atom
  14. Now the questions again with their answers.
  15. =======================================================================
  16. Q. Imapsync fails with the following error, what can I do?
  17. Host1 failure: Error login on [imap.example.com] with user [foo] auth [LOGIN]: 2 NO [AUTHENTICATIONFAILED] Authentication failed
  18. R. One over four imapsync synchronizations end up quickly with the error message
  19. "Authentication failed" or "NO LOGIN failed" or a similar message.
  20. Authentication failure is the primary failure with imapsync
  21. and since nothing tangible can be done without authentication,
  22. this stage must succeed to go further.
  23. Here is some advice to get you to pass this difficult stage of authentication:
  24. * Triple-check each credential parameter. It's not always a password problem,
  25. it can be the wrong host or the wrong user.
  26. There are three parameters on each side:
  27. * triple check --host1
  28. * triple check --user1
  29. * triple check --password1
  30. * triple check --host2
  31. * triple check --user2
  32. * triple check --password2
  33. * If you can authenticate successfully with another imap client software
  34. like Thunderbird or Outlook or Sparrow then it is a very good sign to
  35. authenticate successfully with imapsync. Examine the parameters of
  36. this other imap client and copy them as is for imapsync.
  37. * Use option --showpasswords
  38. At the beginning of the output, imapsync dumps all its command
  39. line parameters; it's the line after "Command line used:".
  40. With --showpasswords, imapsync prints the passwords received
  41. instead of the string MASKED. It helps with debugging quoting issues.
  42. Option --showpasswords shows passwords again when the IMAP dialog
  43. is dumped by --debugimap option. Search for a line like
  44. "Sending: 2 LOGIN test1 secret1" (secret1 is the password here).
  45. * It is sometimes very hard to quote correctly unusual characters,
  46. especially on Windows (and Mac sometimes). See
  47. https://imapsync.lamiral.info/FAQ.d/FAQ.Passwords_on_Windows.txt
  48. https://imapsync.lamiral.info/FAQ.d/FAQ.Passwords_on_Unix.txt
  49. https://imapsync.lamiral.info/FAQ.d/FAQ.Passwords_on_Mac.txt
  50. The quickest trick may be to change the password temporally
  51. with easy characters like the classical alphabet, one long
  52. string still ensures strong security.
  53. * Sometimes some servers announce they support LOGIN but it
  54. fails because the authentication mechanism
  55. working is something else like CRAM-MD5 or PLAIN.
  56. So:
  57. * Try --authmech1 CRAM-MD5 (or --authmech2 CRAM-MD5)
  58. * Try --authmech1 PLAIN (or --authmech2 PLAIN)
  59. * Manually test a login via ssl.
  60. Use either ncat or telnet-ssl or openssl commands, like in the
  61. following examples with imap.gmail.com server:
  62. ncat --ssl -C imap.gmail.com 993
  63. telnet-ssl -z ssl imap.gmail.com 993
  64. openssl s_client -crlf -connect imap.gmail.com:993
  65. Replace imap.gmail.com by your imap server.
  66. The three commands do the same work here.
  67. Typical dialog for an imap LOGIN command:
  68. * OK Gimap ready for requests from 78.196.254.58 q1mb175739668wix
  69. a LOGIN "gilles.lamiral@gmail.com" "secret"
  70. * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE ... ESEARCH
  71. a OK gilles.lamiral@gmail.com Gilles Lamiral authenticated (Success)
  72. b LOGOUT
  73. * BYE LOGOUT Requested
  74. b OK 73 good day (Success)
  75. The client part you have to type is
  76. a LOGIN ...
  77. b LOGOUT
  78. while replacing ... by your credentials values,
  79. other lines are the server responses. Letters
  80. a and b are identifiers of IMAP commands, you have to
  81. type them but you can chose any string instead of a or b.
  82. Some other examples:
  83. ncat --ssl test.lamiral.info 993
  84. c1 LOGIN test1 "secret1"
  85. c2 LOGOUT
  86. openssl s_client -crlf -connect test.lamiral.info:993
  87. c1 LOGIN test1 "secret1"
  88. c2 LOGOUT
  89. ncat --ssl -C outlook.office365.com 993
  90. a LOGIN gilles.lamiral@outlook.com topsecret
  91. b LOGOUT
  92. telnet-ssl -z ssl test.lamiral.info 993
  93. c1 LOGIN test1 "secret1"
  94. c2 LOGOUT
  95. =======================================================================
  96. Q. Imapsync fails with the following error, what can I do?
  97. Host2 failure: Error login on [imap.example.com] with user [foo] auth [LOGIN]: 2 BAD Invalid characters in atom
  98. R. It might be a Dovecot imap server. The password string might
  99. contain special characters that Dovecot doesn't like. Change them.
  100. =======================================================================
  101. =======================================================================