Skip to content

SMTP Sasl authentication failed : password is too long #155

Closed

Description

@pniotout

Describe the bug
I'm connecting to a smtp server via SASL / XOAUTH2 with a long password (1508 characters)

got the error :
DEBUG SMTP: protocolConnect login, host=.fr, user=@*******.fr, password=
DEBUG SMTP: Authenticate with SASL
DEBUG SMTP: SASL mechanisms allowed: XOAUTH2
DEBUG SMTP: SASL Mechanisms:
DEBUG SMTP: XOAUTH2
DEBUG SMTP:
DEBUG SMTP: SASL client XOAUTH2
DEBUG SMTP: SASL callback length: 2
DEBUG SMTP: SASL callback 0: javax.security.auth.callback.NameCallback@5af9926a
DEBUG SMTP: SASL callback 1: javax.security.auth.callback.PasswordCallback@43c67247
AUTH XOAUTH2 [LONG PASSWORD]
500 5.5.2 Line too long
DEBUG SMTP: SASL authentication failed

Expected behavior
I must have been connected

Additional context
I found the problem is in SMTPSaslAuthenticator class :
image

proposed solution :
image

Tested with the same password and it's working great.

Activity

  1. added a commit that references this issue on Oct 18, 2026
    c93271f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions