feat(BOUN-1955): Second part of SMTP implementation#88
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR completes the “SMTP → IC” direction by introducing an IC-backed delivery/recipient-resolution implementation and gating the SMTP subsystem behind a new smtp feature, alongside performance-focused changes in the SMTP inbound server.
Changes:
- Added IC SMTP request execution +
IcSmtpDeliveryAgentto validate recipients and deliver parsed MIME messages to IC canisters. - Optimized SMTP inbound path (pre-rendered HELO/EHLO responses, reduced allocations for replies/errors).
- Introduced
smtpfeature flag and updated dependencies/exports accordingly.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| ic-bn-lib/tools/smtp_server.rs | Removes the standalone SMTP server tool binary source. |
| ic-bn-lib/src/smtp/server.rs | Adds accept() failure throttling and cleans imports. |
| ic-bn-lib/src/smtp/mod.rs | Renames/extends core SMTP types (e.g., EmailMessage, richer resolve errors, from passed to resolver). |
| ic-bn-lib/src/smtp/inbound/session.rs | Allocation reductions in replies/errors; adjusts state machine responses. |
| ic-bn-lib/src/smtp/inbound/rcpt_to.rs | Passes sender to resolver; richer error mapping; avoids heap formatting. |
| ic-bn-lib/src/smtp/inbound/mod.rs | Precomputes HELO/EHLO responses; adds SMTP caps; updates/extends tests. |
| ic-bn-lib/src/smtp/inbound/mail_from.rs | Adds sender-domain validation and allocation reduction for SPF error messages. |
| ic-bn-lib/src/smtp/inbound/ehlo.rs | Switches EHLO/HELO output to pre-rendered buffers. |
| ic-bn-lib/src/smtp/ic/mod.rs | Adds IC SMTP request executor trait/impl and MIME→candid message parsing. |
| ic-bn-lib/src/smtp/ic/delivery_agent.rs | Implements IC-backed delivery + recipient validation, including MX canister lookup + caching. |
| ic-bn-lib/src/smtp/ic/candid.rs | Updates candid model (notably Envelope.to becomes a list) and derives equality. |
| ic-bn-lib/src/smtp/address.rs | Adds conversions to candid Address and parsing helper; adds PartialEq<&str>. |
| ic-bn-lib/src/lib.rs | Gates smtp module behind feature; adds email! macro. |
| ic-bn-lib/src/custom_domains/mod.rs | Introduces LooksUpCustomDomain abstraction for SMTP IC integration. |
| ic-bn-lib/Cargo.toml | Adds smtp feature; makes SMTP deps optional; removes smtp-server bin entry; adds dev-dep for tests. |
| Cargo.toml | Adds workspace deps for arrayvec and mail-send. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
frankdavid
approved these changes
May 21, 2026
Contributor
Author
|
@frankdavid thanks for the review! 👍 I'll merge this as-is now and will address the comments in the next PR for simplicity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IcSmtpDeliveryAgentArrayString, pre-render EHLO/HELO etc)