Skip to content

fix(routing): spurious warning when user DefaultMailbox is set to "Default"#2071

Merged
rnwood merged 2 commits into
masterfrom
copilot/fix-default-mailbox-warning
Mar 3, 2026
Merged

fix(routing): spurious warning when user DefaultMailbox is set to "Default"#2071
rnwood merged 2 commits into
masterfrom
copilot/fix-default-mailbox-warning

Conversation

Copilot AI commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

When a user's DefaultMailbox is configured as "Default" (the implicit fallback), the server logged a warning on every received message because it searched for "Default" in the explicitly configured mailboxes list — where it never appears, since it's auto-created at runtime.

Change

In Smtp4devServer.cs, skip the configured-mailbox lookup when userDefaultMailbox equals MailboxOptions.DEFAULTNAME:

// Before
if (!string.IsNullOrWhiteSpace(userDefaultMailbox))

// After
if (!string.IsNullOrWhiteSpace(userDefaultMailbox) &&
    !string.Equals(userDefaultMailbox, MailboxOptions.DEFAULTNAME, StringComparison.OrdinalIgnoreCase))

The warning Mailbox 'Default' was not found. Falling back to default mailbox is now only emitted when a user references a genuinely missing non-default mailbox name.

Original prompt

This section details on the original issue you should resolve

<issue_title>User is set with Default as mailbox, logging [WRN] Mailbox 'Default' was not found. Falling back to default mailbox</issue_title>
<issue_description>No mailboxes created, only a User. Mail is received and relays fine, but each time this logs as Warning:

  • [WRN] Mailbox 'Default' was not found. Falling back to default mailbox

In case it matters, "Deliver messages to sending user's default mailbox" is checked.</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.

Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix warning for missing default mailbox Fix spurious warning when user DefaultMailbox is set to "Default" Mar 3, 2026
@sonarqubecloud

sonarqubecloud Bot commented Mar 3, 2026

Copy link
Copy Markdown

@rnwood

rnwood commented Mar 3, 2026

Copy link
Copy Markdown
Owner

@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 eb34989 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/5878/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/5878/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.

Copilot AI commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

@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 you...

Investigated the build failure. The failing test is E2ETests_Pop3_RetrieveAnd_Delete.RetrieveThenDeleteMessage(pop3Mode: "ImplicitTls"), which fails with:

[FTL] SMTP server failed to start. TlsMode: "StartTls", Port: 25, AllowRemoteConnections: true, Exception: CryptographicException

This is a pre-existing CI infrastructure issue — the same failure occurs in other unrelated PRs (e.g., build 5877 for PR #1608). It's caused by a TLS certificate not being available in the Windows CI environment, and is not related to the change in commit eb34989.

@rnwood rnwood changed the title Fix spurious warning when user DefaultMailbox is set to "Default" fix(routing): spurious warning when user DefaultMailbox is set to "Default" Mar 3, 2026
@rnwood rnwood marked this pull request as ready for review March 3, 2026 21:11
@rnwood rnwood merged commit 1d92dca into master Mar 3, 2026
19 of 24 checks passed
@rnwood

rnwood commented Mar 3, 2026

Copy link
Copy Markdown
Owner

@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 eb34989 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/5889/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/5889/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.

User is set with Default as mailbox, logging [WRN] Mailbox 'Default' was not found. Falling back to default mailbox

2 participants