You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: wrong username property used when password authentication is not needed #429
Hello! I faced some problem using Simple Java Mail, version 7.5.1, about the prop username.
When passing the prop username, Jakarta Mail does not recognize it. Debugging the code, I found this: in class org.simplejavamail.api.mailer.config.TransportStrategy line 104:
Hmm, it seems you're on to something. For authenticated SMTP servers this is not an issue, as the property is ignored in that case. For SMTP users that don't require a password though, the property is used and it looks like it is the wrong property. I'm still looking into how this is possible, because that property is a core mechanic since the start of the library. It's possibly one of the least tested functions though (passwordless connections).
Your use case is a strange one though; either an SMTP sever requires authentication or it doesn't. If it does, a password is required and then everything is fine as I said. However, if there is no authentication needed by the server, the user name is not necessarily required. I suppose it depends on the server implementation how it deals with missing username, but the test server Wiser, which I use in my junit tests, doesn't have any issue no matter the configuration.
The property used in case of missing password is wrong though, so I'll release a new version with the fix for that at least.
changed the title [-]Wrong username property used when password authentication is not needed[/-][+]Bug: wrong username property used when password authentication is not needed[/+]on Dec 25, 2022
Thank you and happy new year!
Em domingo, 25 de dezembro de 2022 08:43:01 BRT, Benny Bottema ***@***.***> escreveu:
Release fix in 7.5.2. Give it a spin!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
Activity
bbottema commentedon Dec 25, 2022
Hmm, it seems you're on to something. For authenticated SMTP servers this is not an issue, as the property is ignored in that case. For SMTP users that don't require a password though, the property is used and it looks like it is the wrong property. I'm still looking into how this is possible, because that property is a core mechanic since the start of the library. It's possibly one of the least tested functions though (passwordless connections).
I'll get back to this.
bbottema commentedon Dec 25, 2022
Your use case is a strange one though; either an SMTP sever requires authentication or it doesn't. If it does, a password is required and then everything is fine as I said. However, if there is no authentication needed by the server, the user name is not necessarily required. I suppose it depends on the server implementation how it deals with missing username, but the test server Wiser, which I use in my junit tests, doesn't have any issue no matter the configuration.
The property used in case of missing password is wrong though, so I'll release a new version with the fix for that at least.
[-]Possible Bug[/-][+]Wrong username property used when password authentication is not needed[/+]#429: mail.<protocol>.username -> mail.<protocol>.user, as per Sun/Ja…
[-]Wrong username property used when password authentication is not needed[/-][+]Bug: wrong username property used when password authentication is not needed[/+]bbottema commentedon Dec 25, 2022
Release fix in 7.5.2. Give it a spin!
denisrdasilva commentedon Dec 26, 2022