https://bugs.kde.org/show_bug.cgi?id=526511

            Bug ID: 526511
           Summary: Gmail IMAP OAuth authentication fails with
                    "TokenStore::Read: failed to open file ... File name
                    too long
    Classification: Applications
           Product: kontact
      Version First unspecified
       Reported In:
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: mail
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

I tried to troubleshoot using chatGPT and it has created this description from
the information I gave it.

DESCRIPTION

When configuring a Gmail account in Kontact/KMail using OAuth (XOAuth), the
Google Groupware resource authenticates successfully and Google Calendar
synchronizes correctly, but the IMAP mail resource briefly reports "Ready"
before immediately going offline.

The journal shows that sasl-xoauth2 attempts to read the OAuth access token as
though it were a filename, resulting in "TokenStore::Read: failed to open file
... File name too long". Authentication then fails and Gmail closes the
connection.

STEPS TO REPRODUCE

1. Open Kontact/KMail on Nobara Linux 44 (Fedora RPM packages).
2. Add a Google account using the Google Groupware resource or the Mail Account
wizard with OAuth (XOAuth).
3. Complete the Google OAuth login and grant all requested permissions.
4. Wait for synchronization to begin.

OBSERVED RESULT

Google Calendar synchronizes successfully.
The IMAP resource briefly reports "Ready" before immediately changing to
"Server is not available".
The journal repeatedly shows:

sasl_client_start failed with: -1 "SASL(-1): generic failure: "

[sasl-xoauth2] auth failed:
TokenStore::Read: failed to open file ya29.a0AX...
File name too long

Connection to server lost
QAbstractSocket::RemoteHostClosedError

EXPECTED RESULT

The Gmail IMAP account should authenticate successfully using OAuth (XOAuth)
and remain connected so that mail can synchronize.

SOFTWARE/OS VERSIONS

Operating System: Nobara Linux 44
KDE Plasma Version: 6.7.4
KDE Frameworks Version: 6.29.0
Qt Version: 6.11.2

Additional package versions:

Kontact: 26.08.0
KMail: 26.08.0
Akonadi Server: 26.08.0
sasl-xoauth2: 0.27-4.fc44

ADDITIONAL INFORMATION

Installed from the Nobara App Center using DNF (native Fedora RPM packages). No
Flatpak version is installed.
Google authentication succeeds.
Google Calendar synchronizes correctly.
Gmail IMAP is configured with SSL/TLS on port 993 using XOAuth.
A successful TLS connection to imap.gmail.com:993 was verified using "openssl
s_client".
The failure appears to occur before authentication completes because
sasl-xoauth2 attempts to interpret the OAuth access token (starting with
"ya29...") as a filename, resulting in "File name too long".
This issue persists after installing sasl-xoauth2, restarting Akonadi, and
rebooting the system.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to