Bug 489610 - XOAUTH2 with 2FA requires daily re-authentication for SMTP
Summary: XOAUTH2 with 2FA requires daily re-authentication for SMTP
Status: REPORTED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-02 13:59 UTC by Aaron
Modified: 2024-12-06 08:50 UTC (History)
1 user (show)

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


Attachments
Hacky patch of kmailtransport (675 bytes, text/plain)
2024-12-06 08:50 UTC, Radek Hušek
Details

Note You need to log in before you can comment on or make changes to this bug.
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.