Enforce read-only outbound permissions in Stalwart#31
Draft
giorgiobrullo wants to merge 1 commit into
Draft
Conversation
Towards EMAIL-1314 Linear: https://linear.app/kagi/issue/EMAIL-1314/enforce-read-only-outbound-restrictions-in-stalwart Co-Authored-With: OpenAI Codex <noreply@openai.com>
giorgiobrullo
marked this pull request as draft
July 24, 2026 11:32
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.
Summary
emailSendatMAIL FROM, so permission changes affect existing SMTP sessions while authentication still succeedsemailSendis denied, preserving inbound delivery through the existing Inbox fail-safeRollout note
Deploy this fork change before Kagi Mail starts synchronizing read-only account permissions.
The new queue source bit distinguishes user Sieve mail from trusted autogenerated mail, but Sieve messages queued by an older binary only carry the legacy autogenerated bit. Those pre-deploy entries cannot be classified safely. Let the old queue drain or expire before running the Kagi Mail permission backfill.
Verification
STORE=Sqlite cargo test -p tests smtp::inbound::auth::auth -- --exact --nocaptureSTORE=Sqlite cargo test -p tests smtp::queue::permission::queued_email_send_permission -- --exact --nocapturecargo check -p smtp -p email -p jmapcargo clippy -p smtp -p email -p jmap(passes with existing warnings)jmap::jmap_testsreached and passed the modified VacationResponse and EmailSubmission phases, then failed later in an unrelated Contacts assertion (Jane's version of John's Address BookvsTest #1)Fixes EMAIL-1314