Skip to content

feat: add ability to disable POP3 and IMAP servers via null port configuration#1998

Merged
rnwood merged 5 commits intomasterfrom
copilot/add-disable-pop3-option
Jan 30, 2026
Merged

feat: add ability to disable POP3 and IMAP servers via null port configuration#1998
rnwood merged 5 commits intomasterfrom
copilot/add-disable-pop3-option

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 28, 2025

POP3 and IMAP servers now consume ports even when unused. Users need the ability to disable them independently.

Changes

  • Pop3Server.cs: Early return in StartAsync() when Pop3Port is null (matching existing IMAP behavior). Fixed ListeningPorts to return empty array when disabled instead of defaulting to port 110.

  • appsettings.json: Document that null port values disable servers.

  • CommandLineParser.cs: Update help text to show empty string disables servers.

Usage

Command line:

smtp4dev --pop3port="" --imapport=""

Config file:

{
  "ServerOptions": {
    "Pop3Port": null,
    "ImapPort": null
  }
}

Environment variables:

export ServerOptions__Pop3Port=
export ServerOptions__ImapPort=

Disabled servers log: [INF] POP3 server disabled - no port configured

Default behavior unchanged - both servers remain enabled by default.

Original prompt

This section details on the original issue you should resolve

<issue_title>Ability to disable POP3</issue_title>
<issue_description>POP3 is new to v3.11.0. I'd ask for the ability to disable it, since if one uses IMAP, it's not always necessary but uses a port. Possibly, others would be interested in similarly disabling IMAP.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits December 28, 2025 22:50
Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>
…ing option

Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>
Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>
Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

Copilot AI changed the title [WIP] Add ability to disable POP3 in v3.11.0 Add ability to disable POP3 and IMAP servers via null port configuration Dec 28, 2025
Copilot AI requested a review from rnwood December 28, 2025 23:08
@rnwood
Copy link
Copy Markdown
Owner

rnwood commented Dec 28, 2025

📊 Code Coverage Report

Coverage Type Percentage Status
Line Coverage 14.3% 🔴
Branch Coverage 4.9% 🔴
Method Coverage 17.6% 🔴

📁 Coverage by Namespace

Namespace Line Coverage Branch Coverage Method Coverage Classes
LumiSoft.Net 0% 🔴 0% 🔴 0% 🔴 23
LumiSoft.Net.AUTH 0% 🔴 0% 🔴 0% 🔴 18
LumiSoft.Net.IMAP 1.7% 🔴 0.4% 🔴 3.9% 🔴 122
LumiSoft.Net.IMAP.Client 0% 🔴 0% 🔴 0% 🔴 8
LumiSoft.Net.IMAP.Server 0% 🔴 0% 🔴 0% 🔴 25
LumiSoft.Net.IO 0% 🔴 0% 🔴 0% 🔴 13
LumiSoft.Net.Log 0% 🔴 0% 🔴 0% 🔴 3
LumiSoft.Net.Mail 0% 🔴 0% 🔴 0% 🔴 14
LumiSoft.Net.MIME 0% 🔴 0% 🔴 0% 🔴 41
LumiSoft.Net.TCP 0% 🔴 0% 🔴 0% 🔴 6
LumiSoft.Net.UDP 0% 🔴 0% 🔴 0% 🔴 3
Rnwood.Smtp4dev 1.9% 🔴 3.3% 🔴 12% 🔴 14
Rnwood.Smtp4dev.ApiModel 58.5% 🔴 54.5% 🔴 44.3% 🔴 17
Rnwood.Smtp4dev.Controllers 3.5% 🔴 4.7% 🔴 9.2% 🔴 11
Rnwood.Smtp4dev.Data 55.6% 🔴 40.9% 🔴 60% 🟡 3
Rnwood.Smtp4dev.DbModel 72.1% 🟡 0% 🔴 67.3% 🟡 6
Rnwood.Smtp4dev.DbModel.Projections 100% 🟢 0% 🔴 100% 🟢 1
Rnwood.Smtp4dev.Hubs 0% 🔴 0% 🔴 0% 🔴 1
Rnwood.Smtp4dev.Migrations 90.2% 🟢 0% 🔴 71.7% 🟡 23
Rnwood.Smtp4dev.Server 15.4% 🔴 14% 🔴 20.3% 🔴 15
Rnwood.Smtp4dev.Server.Imap 84.8% 🟢 85.3% 🟢 78.9% 🟡 2
Rnwood.Smtp4dev.Server.Pop3 76.1% 🟡 65.2% 🟡 96.8% 🟢 2
Rnwood.Smtp4dev.Server.Pop3.CommandHandlers 48.3% 🔴 26.1% 🔴 84.6% 🟢 12
Rnwood.Smtp4dev.Server.Settings 67.1% 🟡 16.7% 🔴 72.1% 🟡 10
Rnwood.Smtp4dev.Service 0% 🔴 0% 🔴 0% 🔴 5
Rnwood.Smtp4dev.TUI 0% 🔴 0% 🔴 0% 🔴 9
Rnwood.SmtpServer 72.1% 🟡 63.2% 🟡 68.3% 🟡 36
Rnwood.SmtpServer.Extensions 67.9% 🟡 25% 🔴 91.3% 🟢 6
Rnwood.SmtpServer.Extensions.Auth 59% 🔴 47.6% 🔴 57.5% 🔴 23
Rnwood.SmtpServer.Verbs 92.9% 🟢 92% 🟢 100% 🟢 12

Overall Coverage Details:

  • Covered Lines: 5983 / 41714
  • Covered Branches: 587 / 11973
  • Covered Methods: 701 / 3973
  • Assemblies Tested: 3
  • Total Classes: 484

📈 View Full Coverage Report

Enhanced coverage report with namespace breakdown - Azure DevOps Build #3.12.0-ci20251228104_pr1998 20251228.5

@rnwood rnwood changed the title Add ability to disable POP3 and IMAP servers via null port configuration feat: add ability to disable POP3 and IMAP servers via null port configuration Jan 30, 2026
@rnwood rnwood marked this pull request as ready for review January 30, 2026 21:16
@rnwood rnwood merged commit 8daeea3 into master Jan 30, 2026
22 of 25 checks passed
@rnwood
Copy link
Copy Markdown
Owner

rnwood commented Jan 30, 2026

@copilot The build triggered by this PR has failed. Please use the Azure DevOps REST API to investigate and fix the issues.

🚨 IMPORTANT: Only proceed if this is the most recent commit on your branch. If a newer commit exists, ignore this notification.

Build Details:

Instructions for @copilot:

  1. First verify this is the latest commit - If d899140 is not the most recent commit in this PR branch, ignore this notification

  2. Use Azure DevOps REST API to get build details and failures:
    `�ash

    Get build overview

    curl -s "https://dev.azure.com/rnwood/smtp4dev/_apis/build/builds/-version=6.0" | jq '{status: .status, result: .result, sourceVersion: .sourceVersion}'

    Get failed tasks and their logs

    curl -s "https://dev.azure.com/rnwood/smtp4dev/_apis/build/builds/5450/timeline?api-version=6.0" | jq '.records[] | select(.result == "failed") | {name: .name, task: .task.name, errorCount: .errorCount, logId: .log.id}'

    Get specific error details from a failed task log (replace LOG_ID)

    curl -s "https://dev.azure.com/rnwood/smtp4dev/_apis/build/builds/5450/logs/LOG_ID" | grep -i "error|failed"
    `

  3. Analyze the error messages from the API responses to identify compilation errors, test failures, or other issues

  4. Make targeted fixes based on the specific error messages found

  5. Build locally after making fixes to verify the solution

The Azure DevOps REST API provides comprehensive build failure information without requiring browser access.

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.

Ability to disable POP3

2 participants