Bug 4351 - Priority is SMTP authentication
Summary: Priority is SMTP authentication
Status: NEW
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: SMTP (show other bugs)
Version: 3.17.5
Hardware: PC Linux
: P3 enhancement
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2020-06-05 11:39 UTC by Fhiss
Modified: 2020-10-05 10:59 UTC (History)
0 users

See Also:


Attachments
switch PLAIN and LOGIN authentication mechanisms so the faster and standardized PLAIN is preferred (1.06 KB, patch)
2020-06-13 08:47 UTC, Hanno Boeck
no flags Details | Diff

Description Fhiss 2020-06-05 11:39:27 UTC
Currently, when choosing an authentication method, Claws Mail uses the first one that the server offers it. Please make it use methods in the following priorities: CRAM-MD5 PLAIN LOGIN.
Comment 1 Ricardo Mones 2020-06-05 15:10:01 UTC
Just twice curious:
- what's the rationale for your list?
- and why is it an enhancement over server offered list?
Comment 2 Fhiss 2020-06-05 19:08:32 UTC
CRAM-MD5 is better than PLAIN and LOGIN because it does not pass the password in plain text, instead using hash comparison. PLAIN is better than LOGIN because it passes the username and password for one SASL interaction, not two, and is also described in the RFC.

The server offers a list that its administrator wrote in the configuration. You can write it in any order you like.
Comment 3 Hanno Boeck 2020-06-13 08:46:58 UTC
I think the original bug description is not correct. The code is in the function smtp_auth here:
https://git.claws-mail.org/?p=claws.git;a=blob;f=src/common/smtp.c;h=2460f7e0455e3d1fbc5715bc3669cc3ca99399b2;hb=HEAD#l156

This looks like it is forcing a method that is configured if there is one, and if not then it is using CRAM-MD5, LOGIN, PLAIN in that order.

I agree however the order should be changed. PLAIN spares a roundtrip, thus it is faster and more likely to work with a weak internet connection. I am attaching a patch that switches PLAIN and LOGIN, which means if both are available PLAIN will be used.

One can argue around the order of CRAM-MD5 vs. the others, but CRAM-MD5 is not widely supported anyway, so I would consider that of minor importance. One may also consider just completely removing LOGIN, as it's never been standardized, it only exists as a 17 year old draft and IANA considers it as obsolete [1].

[1] https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml
Comment 4 Hanno Boeck 2020-06-13 08:47:36 UTC
Created attachment 2063 [details]
switch PLAIN and LOGIN authentication mechanisms so the faster and standardized PLAIN is preferred

Note You need to log in before you can comment on or make changes to this bug.