Skip to content

feat(NODE-1955): SMTP: More observability, add notifications handler etc#95

Merged
blind-oracle merged 11 commits into
mainfrom
igor/smtp-v5
Jun 1, 2026
Merged

feat(NODE-1955): SMTP: More observability, add notifications handler etc#95
blind-oracle merged 11 commits into
mainfrom
igor/smtp-v5

Conversation

@blind-oracle

Copy link
Copy Markdown
Contributor
  • Adds handler for message delivery / session finish notifications - needed for further integration with Vector to emit events (ReceivesNotifications trait)
  • Track last error during session (ProtocolError)
  • Move tests to tests.rs
  • More detailed logging here and there

@blind-oracle blind-oracle requested a review from a team as a code owner June 1, 2026 11:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the SMTP inbound stack with richer observability by introducing notification hooks, tracking protocol/message errors in session metadata, and updating the delivery agent interface to receive session context.

Changes:

  • Add ReceivesNotifications, MessageError, and ProtocolError to emit message/session/protocol events and track last protocol error.
  • Thread SessionMeta through delivery and notification paths; update SMTP session logic to record/report protocol errors.
  • Move inbound SMTP tests into a dedicated tests.rs module and expand tests to cover notifications.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
ic-bn-lib/src/smtp/mod.rs Adds notification trait + structured error enums; changes delivery trait to accept SessionMeta.
ic-bn-lib/src/smtp/inbound/mod.rs Introduces SessionMeta, tracks message_id/last_error, and adds notification plumbing (set_error).
ic-bn-lib/src/smtp/inbound/session.rs Records protocol errors, emits message notifications (success/failure), and uses stable message_id per transaction.
ic-bn-lib/src/smtp/inbound/manager.rs Adds session-finish notifications and refactors TLS handling/handshake error reporting.
ic-bn-lib/src/smtp/inbound/ehlo.rs Emits ProtocolError for EHLO validation failures.
ic-bn-lib/src/smtp/inbound/mail_from.rs Emits ProtocolError for MAIL FROM sequencing/validation/SPF/reverse-IP failures.
ic-bn-lib/src/smtp/inbound/rcpt_to.rs Emits ProtocolError for RCPT TO sequencing/validation/resolution failures.
ic-bn-lib/src/smtp/inbound/tests.rs New extracted inbound SMTP test module; adds notification handler coverage.
ic-bn-lib/src/smtp/ic/delivery_agent.rs Updates IC delivery agent to accept SessionMeta and adjusts logging/tests.
ic-bn-lib/src/lib.rs Re-exports rcgen.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ic-bn-lib/src/smtp/inbound/manager.rs Outdated
Comment thread ic-bn-lib/src/smtp/inbound/manager.rs Outdated
Comment thread ic-bn-lib/src/smtp/inbound/manager.rs
Comment thread ic-bn-lib/src/smtp/mod.rs Outdated
Comment thread ic-bn-lib/src/smtp/mod.rs Outdated
Comment thread ic-bn-lib/src/smtp/mod.rs
Comment thread ic-bn-lib/src/smtp/inbound/session.rs Outdated
Comment thread ic-bn-lib/src/smtp/inbound/mod.rs Outdated
Comment thread ic-bn-lib/src/smtp/inbound/session.rs Outdated
Comment thread ic-bn-lib/src/smtp/inbound/session.rs Outdated
Comment thread ic-bn-lib/src/smtp/inbound/session.rs Outdated
@blind-oracle blind-oracle merged commit 89a83b3 into main Jun 1, 2026
6 checks passed
@blind-oracle blind-oracle deleted the igor/smtp-v5 branch June 1, 2026 13:39
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.

3 participants