Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: empty smtp username and password behaviour #333

Closed
VK-SMILECDR opened this issue Aug 10, 2021 · 3 comments
Closed

Question: empty smtp username and password behaviour #333

VK-SMILECDR opened this issue Aug 10, 2021 · 3 comments
Labels
Milestone

Comments

@VK-SMILECDR
Copy link

VK-SMILECDR commented Aug 10, 2021

Hi @bbottema

Thanks for the excellent and simple to use library

Question

  • Does SimpleJavaMail consider empty and not null smtp username and/or password as a requirement to authenticate mail client to mail server?
  • Is this expected behaviour?

Example

Based on the code review, the following looks like current logic in SimpleJavaMail:

  • when the username is null no authentication required.
  • when the username is empty and not null ("") authentication required
@bbottema
Copy link
Owner

That's correct. If the user wouldn't want authentication, then username/password should be null, which seem the canonical principle to apply. I suppose it's technically possible to setup an authenticated SMTP server with empty values, which would be different from not having to authenticate at all. I could default empty username/password to mean the same as null-values, but I'm not sure that would make more sense.

Do you have reason to believe otherwise?

@bbottema
Copy link
Owner

Well that would be #331

@bbottema
Copy link
Owner

And so this change has been released in 6.7.4

@bbottema bbottema added this to the 6.7.4 milestone Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants