lukencode / FluentEmail

All in one email sender for .NET. Supports popular senders (SendGrid, MailGun, etc) and Razor templates.
https://lukelowrey.com/dotnet-email-guide-2021/
MIT License
3.02k stars 434 forks source link

[MailKitSender] Per client ServerCertificateValidationCallback #338

Open Whivel opened 2 years ago

Whivel commented 2 years ago

[FluentEmail.MailKit] I added a new option in SmtpClientOptions to give the opportunity to specify a ServerCertificateValidationCallback per client. If specified the callback is assigned to the MailKit SmtpClient and it will be used instead of the default one. In that way it is possible to avoid the use of the global variable "ServicePointManager.ServerCertificateValidationCallback"

Whivel commented 2 years ago

duplicate #333

aravindk777 commented 6 months ago

There are two possible dupes/similar implementations: #333 and #256. Are we going to keep this or has any additional abilities compared to other two? so we can review the most beneficial PR?

Whivel commented 6 months ago

in #256 and in #333 they both forgot to add the same features to the SendAsync method. Both prs pass and use CheckCertificateRevocation which is not in this pr.

in #333 the callback method is not passed.

I think #256 and #333 cannot be merged because they are incomplete because they miss the same change in the async method and.

338 (this) could be merged but i think CheckCertificateRevocation should be added (in this or with another pr)

aravindk777 commented 6 months ago

in #256 and in #333 they both forgot to add the same features to the SendAsync method. Both prs pass and use CheckCertificateRevocation which is not in this pr.

in #333 the callback method is not passed.

I think #256 and #333 cannot be merged because they are incomplete because they miss the same change in the async method and. #338 (this) could be merged but i think CheckCertificateRevocation should be added (in this or with another pr)

So, @Whivel - do you want to add that CheckCertificateRevocation in to this PR and then we can review and merge? Or do you intend to do that as separate PR?