On Sun, Jan 11, 2026 at 09:01:40PM +0800, Kevin McCarthy wrote:
> As described in the previous commit, some servers send a non-base64
> encoded challenge in the initial response.
> 
> Ignore the base64 decode failure for the first challenge, to improve
> compatibility in the gsasl authentication code too.
> 
> This is modeled after the same gsasl fix in smtp.c.
> ---
>  Yao Zi, would you mind checking if this patch works for you too with
>  the failing POP3 server?  You'll need to configure with --with-gsasl.

I could reproduce the problem with GSASL and POP3, my distribution takes
Cyrus SASL by default so I don't check that code path originally.

Mutt is built with,

        ./configure --enable-pop --with-gsasl --with-ssl --enable-debug

readelf shows libgsasl.so is indeed linked to,

0x0000000000000001 (NEEDED)             Shared library: [libncursesw.so.6]
0x0000000000000001 (NEEDED)             Shared library: [libssl.so.3]
0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.3]
0x0000000000000001 (NEEDED)             Shared library: [libgsasl.so.18]
0x0000000000000001 (NEEDED)             Shared library: [libintl.so.8]
0x0000000000000001 (NEEDED)             Shared library: [libc.musl-x86_64.so.1]

Run mutt with -d 5 and then connect to my provider without the patch,

[2026-01-11 14:36:15] 6> CAPA
[2026-01-11 14:36:15] 6< +OK
[2026-01-11 14:36:15] 6< USER
[2026-01-11 14:36:15] 6< TOP
[2026-01-11 14:36:15] 6< UIDL
[2026-01-11 14:36:15] 6< SASL PLAIN XOAUTH2
[2026-01-11 14:36:15] 6< .
[2026-01-11 14:36:15] pop_authenticate: Using any available method.
[2026-01-11 14:36:15] pop_auth_gsasl: using mech PLAIN
[2026-01-11 14:36:15] Authenticating (PLAIN)...
[2026-01-11 14:36:15] 6> AUTH PLAIN
[2026-01-11 14:36:16] 6< + Ready for additional text
[2026-01-11 14:36:16] gsasl_step64() failed (8): Base 64 coding error in SASL 
library
[2026-01-11 14:36:16] 6> *
[2026-01-11 14:36:16] pop_auth_gsasl: PLAIN failed

And with the patch,

[2026-01-11 14:38:19] 6> CAPA
[2026-01-11 14:38:19] 6< +OK
[2026-01-11 14:38:19] 6< USER
[2026-01-11 14:38:19] 6< TOP
[2026-01-11 14:38:19] 6< UIDL
[2026-01-11 14:38:19] 6< SASL PLAIN XOAUTH2
[2026-01-11 14:38:19] 6< .
[2026-01-11 14:38:19] pop_authenticate: Using any available method.
[2026-01-11 14:38:19] pop_auth_gsasl: using mech PLAIN
[2026-01-11 14:38:19] Authenticating (PLAIN)...
[2026-01-11 14:38:19] 6> AUTH PLAIN
[2026-01-11 14:38:19] 6< + Ready for additional text
[2026-01-11 14:38:20] 6> [REDACTED]
[2026-01-11 14:38:20] 6< +OK
[2026-01-11 14:38:20] 6> CAPA
[2026-01-11 14:38:21] 6< +OK
[2026-01-11 14:38:21] 6< TOP
[2026-01-11 14:38:21] 6< UIDL
[2026-01-11 14:38:21] 6< SASL PLAIN XOAUTH2
[2026-01-11 14:38:21] 6< .
[2026-01-11 14:38:21] 6> STAT
[2026-01-11 14:38:21] 6< +OK 0 0
[2026-01-11 14:38:21] Checking for new messages...

So I think it fixes the problem, thanks for the patch! And for record,
I'm using the paid service of zoho.com, not sure whether their free plan
is affected or not.

Best regards,
Yao Zi

Reply via email to