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
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.