eclipse-ee4j / eclipse-ee4j/angus-mail

SMTP Sasl authentication failed : password is too long

Open
#155 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
87
Forks
23
PR merge metrics
No merged PRs in 30d

Description

**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](https://github.com/user-attachments/assets/51cc55b0-139a-47f2-95e1-16d6cb39bdcf)

proposed solution :
![image](https://github.com/user-attachments/assets/01080e9b-41c1-44a6-9def-40e578ab0ac1)

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.