log4net.Ext.Mail - #302
Draft
FreeAndNil wants to merge 11 commits into
Draft
Conversation
log4net.Ext.Mail.Appender.SmtpAppender exposes the same options as log4net.Appender.SmtpAppender, but sends via MailKit instead of the obsolete System.Net.Mail.SmtpClient. Sending goes through the new ISmtpTransport abstraction (default: MailKitSmtpTransport) so the appender can be tested without an SMTP server.
(log messages could be dropped via HasConnections race) - test: free TCP port, locked receive buffer, assert on stream content instead of read count, 30s timeout, log client errors
Recommend the MailKit appender from log4net.Ext.Mail over the built-in one, which relies on the deprecated System.Net.Mail.SmtpClient, and port all configuration samples to the new type. Adds the changelog entry for #300.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #300
Microsoft no longer recommends
System.Net.Mail.SmtpClient, and it increasinglyfails against modern mail servers. This adds a satellite assembly
log4net.Ext.Mailwith a MailKit basedSmtpAppender, so log4net itself takes onno mail dependency.
log4net.Appender.SmtpAppender- migrating means changing onlythe
typeattribute.smtpHostis required,enableSslnegotiates implicitTLS/STARTTLS automatically,
Ntlmneeds explicit credentials (MailKit cannotreuse the Windows logon session), and semicolon-separated recipient lists now
parse correctly.
Log4NetAssert.EnsureNotNullOrEmpty.Also included, unrelated to #300: TelnetAppender registers the client before
sending the welcome banner, fixing a
HasConnectionsrace that dropped messages.