1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2026-03-20 11:23:41 +01:00
aerc/lib/send
Folker Schwesinger daea912a83 auth: fallback to login if plain isn't supported
Do not assume "plain" is the default authentication mechanism. If no
mechanism is explicitly set in the connection URI, return an empty
string. The IMAP worker already falls back to "login" if "plain" is not
supported by the server.

Fix the "login" fallback in the IMAP worker to issue an IMAP LOGIN [1]
command instead of a SASL AUTHENTICATE [2] command. This is necessary
because the server may not advertise LOGIN as a separate AUTH
capability.
If, however, the server explicitly advertises the LOGINDISABLED
capability do not fall back to LOGIN, because [1] states:

  A client implementation MUST NOT send a LOGIN command if the
  LOGINDISABLED capability is advertised.

[1]: https://www.rfc-editor.org/rfc/rfc3501#section-6.2.3
[2]: https://www.rfc-editor.org/rfc/rfc3501#section-6.2.2

Fixes: 018e6f81f4 ("lib: consolidate SASL authentication code")
Signed-off-by: Folker Schwesinger <dev@folker-schwesinger.de>
Acked-by: Robin Jarry <robin@jarry.cc>
2026-03-15 17:39:12 +01:00
..
jmap.go messages: generalize cancellation context 2026-02-09 14:46:27 +01:00
parse.go lib: consolidate SASL authentication code 2026-02-09 14:46:27 +01:00
sender.go send: fix double close and swallowed write error 2026-02-13 08:53:30 +01:00
sendmail.go completion: display descriptions next to choices 2024-10-23 10:22:51 +02:00
smtp.go auth: fallback to login if plain isn't supported 2026-03-15 17:39:12 +01:00