Bug 414488 - Can't connect to a certain IMAP server
Summary: Can't connect to a certain IMAP server
Status: REPORTED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: IMAP resource (show other bugs)
Version: 5.10.3
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-25 10:19 UTC by andrea.mueller@amuezuhause.de
Modified: 2024-10-25 07:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andrea.mueller@amuezuhause.de 2019-11-25 10:19:38 UTC
SUMMARY
Since I upgraded from openSUSE Leap 15.0 to 15.1 I don't get a connection to the IMAP server at my work.
There is an error message:
"Anmeldung fehlgeschlagen, PLAIN-Anmeldung wird von diesem Server abgelehnt."
Means: "Login failed, PLAIN-Authentication denied by the server." ( It's only my translation.)

STEPS TO REPRODUCE
1. Add an IMAP account with the config like before
2. doesn't get a connection
3. 

OBSERVED RESULT

The error message appears. No connection

EXPECTED RESULT
Should connect like it was before the upgrade

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.55.0
Qt Version: 5.9.7

ADDITIONAL INFORMATION

The IMAP server doesn't provide an AUTH method in his capabilities. But PLAIN should be the standard.
With rainloop (in Nextcloud) and Trojita there is no problem with the connection.

I tried also with my laptop with openSUSE Tumbleweed: KDE Frameworks Version 5.64.0, Qt Version 5.13.1
No connection anyway.
Comment 1 Astib 2024-10-25 07:23:15 UTC
Even a bit weird as this report is quite old, this may match my observation to with my Kmail:

Running Kubuntu 24.04:
```
kmail/noble-updates,now 4:23.08.5-0ubuntu5.1 amd64 [installed]
  full featured graphical email client

kmailtransport-akonadi/noble,now 23.08.5-0ubuntu3 amd64 [installed,automatic]
  mail transport akonadi library
```

I found something - because I have TLS mitm proxy at disposal, I discovered that there is problem in 
PLAIN base64 calculation when composing the AUTH PLAIN payload.

It should be:
`<account_name>:<password>  `

Problem is not related only to IMAP, but it's the case also for SMTP. 

What it does (IMAP - separator is not ':'):
`<account_name><account_name><password>`

What it does (SMTP - separator is missing)
`<account_name><password>`

If I replace AUTH PLAIN payloads with correctly composed ones, all works well.
Since I replaced payload inline with mitm proxy, I guarantee it's not a password issue, or some user or server error/mistake.

The problem is probably in the code which composes username and password into base64 payload.
It _may_ be depending on CAPABILITIES sent from server, because my other IMAP/SMTP services work well.
Comment 2 Astib 2024-10-25 07:32:29 UTC
If time allows and also you help me and direct me to likely related code parts, I can do my own research and try to contribute with a patch.