Bug 489610

Summary: XOAUTH2 with 2FA requires daily re-authentication for SMTP
Product: [Applications] kmail2 Reporter: Aaron <mullein>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: normal CC: husek
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Hacky patch of kmailtransport

Description Aaron 2024-07-02 13:59:59 UTC
SUMMARY
When using XOAUTH2 with two-factor authentication for an Outlook account, outgoing email fails after some period of time and a re-authentication is required to send mail again. Incoming mail with IMAP seems to work fine. Outgoing mail works as expected for some period of time after authenticating with 2FA. 


STEPS TO REPRODUCE
1. Set up SMTP with 2FA and XOAUTH2
2. Wait an unknown period of time
3. Try to send an email

OBSERVED RESULT
Authentication for the outgoing mail fails.

EXPECTED RESULT
Outgoing mail should send without issue.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo Linux
(available in About System)
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kmail: 24.05.1
Comment 1 Radek HuĊĦek 2024-12-06 08:50:35 UTC
Created attachment 176385 [details]
Hacky patch of kmailtransport

I had the same issue. Forcing refresh of access token every time (eg. by applying the attached patch to kmailtransport) seems to fix it. But it is more of a hack than proper solution.