Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`smtps://` email connection string without a port connects to port 25 with no TLS

オープン 初心者向け
#2,697 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
backend, security

調査の方向性

まず src/Exceptionless.Core/Utility/SmtpUri.cs と src/Exceptionless.Core/Configuration/EmailOptions.cs を確認し、生成された暗号化オプションが MailKitMailSender に渡されるまでの流れを追ってください。説明に従って smtp://host、smtps://host、smtps://host:587 のテストを追加し、該当するテストを実行してください。smtps URI がセキュアなトランスポートを維持し、期待されるポートと TLS モードを選択すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

SmtpUri sets port 465 for an smtps:// URI with no explicit port, then overwrites it with 25 a few lines later. Because the encryption default is derived from the port, the mailer then connects to port 25 with no TLS. The parsed IsSecure flag is never used.

Where

  • SmtpUri constructor sets Port = uri.IsDefaultPort ? 465 : uri.Port for smtps, then L41 unconditionally runs Port = uri.IsDefaultPort ? 25 : uri.Port. System.Uri has no default port for smtps, so IsDefaultPort is true and Port is -1 whenever the port is omitted.
  • EmailOptions.ReadFromConfiguration copies host, port, user and password but not IsSecure, and defaults SmtpEncryption from the port via GetDefaultSmtpEncryption (25 maps to None).
  • MailKitMailSender connects with SecureSocketOptions.None and then authenticates.

Steps to reproduce

  1. Set EX_ConnectionStrings__Email=smtps://user:[email protected] (no port) and leave EX_SmtpEncryption unset.
  2. Trigger any email (e.g. a password reset). The mailer connects to smtp.example.com:25 without TLS and sends AUTH with the credentials in the clear, or fails if port 25 is blocked or the server requires TLS.

Expected

smtps://host connects to port 465 with implicit TLS (SslOnConnect). More generally, the smtps scheme should select TLS regardless of port.

Suggested fix

Remove the trailing Port = uri.IsDefaultPort ? 25 : uri.Port; in SmtpUri (the scheme branches already set the port). In EmailOptions, when SmtpEncryption isn't configured and uri.IsSecure is true, default to SSL for port 465 and StartTLS for other ports instead of None. Add SmtpUri tests for smtp://host, smtps://host, and smtps://host:587.

主要言語
C#
スター
2.5k
フォーク
508
平均マージ
2日 17時間
マージ済み PR(30日)
40

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

exceptionless/Exceptionless のほかの issue

exceptionless/Exceptionless の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。