Skip to content

Upgrade MailKit to 5.0 - #2725

Merged
ejsmith merged 1 commit into
mainfrom
chore/mailkit-5
Nov 11, 2026
Merged

ejsmith merged 1 commit into
mainfrom
chore/mailkit-5

Conversation

@ejsmith

@ejsmith ejsmith commented Nov 11, 2026

Copy link
Copy Markdown
Member

Upgrade MailKit from 4.18.2 to 5.0.0, a major release that drops BouncyCastle and moves to MimeKit.Core.

Change Why
MailKit 4.18.2 → 5.0.0 Follow-up from the .NET 11 upgrade (#2665).
Add using MailKit; to MailKitMailSender SmtpClient.SendAsync(MimeMessage) is now an extension method in the MailKit namespace (porting guide §2.1). Its return value changed to SendResult; we ignore it.
Remove the System.Security.Cryptography.Pkcs 11.0.0 pin It only existed because MimeKit 4 allowed the vulnerable 10.0.0. MimeKit.Core 5 doesn't depend on Pkcs at all, and Pkcs is gone from the restore graph.

We only send HTML mail over SMTP, so none of the IMAP, S/MIME, DKIM, mock, or 64-bit size changes in the porting guide apply.

Behavior changes that still compile and might matter:

  • Multi-line SMTP responses are joined with \r\n. We don't parse them.
  • MailKit's mailkit.net.* metrics report more specific error.type values. We don't collect those meters.

Validation:

  • Solution builds with 0 warnings.
  • dotnet list package --vulnerable --include-transitive is clean.
  • Sent a real message through MailKitMailSender to the local Mailpit. It arrived with the HTML body and the X-Mailer-Machine, Auto-Submitted, and X-Auto-Response-Suppress headers intact.
  • No test covers MailKitMailSender (tests use NullMailer), so CI here mainly confirms the build.

MailKit 5 drops BouncyCastle and depends on MimeKit.Core, which no longer
pulls in System.Security.Cryptography.Pkcs, so remove the Pkcs pin that
covered MimeKit's vulnerable 10.0.0 range. The SendAsync(MimeMessage)
overload moved to an extension method in the MailKit namespace.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T22:18:44.769986Z 60ab944 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.AppHost 23% 22% 130 ❌
Exceptionless.Core 78% 70% 11007 ✔
Exceptionless.Insulation 51% 43% 370 ➖
Exceptionless.Web 86% 72% 9415 ✔
Summary 81% (28639 / 35508) 70% (14323 / 20508) 20922 ✔

@ejsmith
ejsmith merged commit ffe1495 into main Nov 11, 2026
21 checks passed
@ejsmith
ejsmith deleted the chore/mailkit-5 branch November 11, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant