serilog-sinks-email icon indicating copy to clipboard operation
serilog-sinks-email copied to clipboard

Initialize NetworkCredentials in EmailConnectionInfo

Open adriangutowski opened this issue 4 years ago • 5 comments

Fixes #90

adriangutowski avatar Dec 15 '20 00:12 adriangutowski

@nblumhardt, could you take a look at my PR?

adriangutowski avatar Jan 07 '21 14:01 adriangutowski

Thanks for the PR! I'm not sure whether this change will prevent the use of default credentials in environments that depend on them - unfortunately I'm short of time to investigate.

Any other maintainers currently following this repo with some bandwidth? :-)

nblumhardt avatar Jan 08 '21 00:01 nblumhardt

@nblumhardt, thank you for your prompt reply. ~~I did some research into this - and apparently it should not be an issue. Take a look at this: https://stackoverflow.com/a/14130274/7980221~~

If we are talking about the following null check, then you are right. https://github.com/serilog/serilog-sinks-email/blob/5fb82c6be87f40fb69e74fe301e57dac55cc6993/src/Serilog.Sinks.Email/Sinks/Email/EmailSink.cs#L135-L138 I need more time to investigate. I will get back to you as soon as I have the solution.

adriangutowski avatar Jan 08 '21 08:01 adriangutowski

@nblumhardt, how about setting the default value for NetworkCredentials to CredentialCache.DefaultNetworkCredentials? Could you take a look at my latest commit (26a2d4e1c0193bf4a237170b6b832f0ad4a86f99)?

adriangutowski avatar Mar 21 '21 19:03 adriangutowski

Sorry Adrian, I don't have any environment in which to test these things, so this has been sitting on my TODO list for a while. Can you share any details of what testing/investigation you've done? (E.g. why do you think this will preserve the existing behavior?)

Many thanks, Nick

nblumhardt avatar Mar 30 '21 23:03 nblumhardt

Closing this one as stale, but thanks for sending the PR!

nblumhardt avatar Jun 09 '24 21:06 nblumhardt