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

Impossible to set Smtp Username/Password to null in appsettings.json #11575

Closed
LennardF1989 opened this issue Nov 3, 2021 · 3 comments
Closed

Comments

@LennardF1989
Copy link
Contributor

Which exact Umbraco version are you using? For example: 8.13.1 - don't just write v8

v9.0.1

Bug summary

Take a look at:

if (!(_globalSettings.Smtp.Username is null && _globalSettings.Smtp.Password is null))

If you have set a "Umbraco.CMS.Global.Smtp" object in your appsettings.json, it's impossible to set username/password to "null" in for example a appsettings.Production.json. When left out they are simply merged, and when set to null (ignoring validation warnings), also causes a merge. The end result is that you should not set username/password on appsettings.json itself if you want appsettings.Development.json to connect to a local SMTP server for example (no username/password).

Specifics

No response

Steps to reproduce

  1. Set Smtp settings with username/password on appsettings.json
  2. Set Smpt settings with username/password set to null on appsettings.Development.json
  3. Inject IEmailSender and send an email.
  4. Code on line above will attempt to authenticate because because username/password is not actually null.

Expected result / actual result

The null-checks should be string.IsNullOrWhiteSpace() or similar.

@umbrabot
Copy link

umbrabot commented Nov 8, 2021

Hi @LennardF1989,

We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post

Thanks muchly, from your friendly Umbraco GitHub bot :-)

@LennardF1989
Copy link
Contributor Author

Fixed in PR #11594!

@nul800sebastiaan
Copy link
Member

Fixed in #11594

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants