Repository navigation
Screen inbound support mail (#1899) - #1968
Merged
Merged
Conversation
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR1968Version: 🤖 Updated on each push. |
This branch was previously deployed
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
Four protections for inbound support mail, in one change (#1893 follow-up, #1899, ADR 0113):
mail_blocklist): a listed address, or a domain with its subdomains, is rejected at delivery before anything is stored. Lookup failure fails open. Our own domain and shared mailbox providers cannot be domain-blocked; our own addresses cannot be blocked at all.mail_tickets.filtered: open but never assigned or announced, hidden from the default list and the unread badge, and appended without a notice or a reopen when it threads into an existing ticket. Spam still wins.MAIL_SENDER_HOURLY_CAP, default 20): overflow is filed asrate_limited.mail_queues.notify): no creation notice; escalation notices still go out.Routes:
GET/POST /admin/mail/blocklist,DELETE /admin/mail/blocklist/:id,POST /admin/mail/tickets/:id/spam,filteredlist filter,notifyon queues. CLI:nemar admin mail spam,blocklist [add|remove],list --filtered,queues set --notify.Migration
0111_mail_screening.sql. Contract changes for the website transcription (shared/contract/mail-admin.ts):FILTER_REASONS,FILTERED_LIST_MODES,BLOCK_KINDS,SPAM_BLOCK_CHOICES.block_not_allowed(422),block_sender_unverified(422).TicketSummary.filtered;ListTicketsQuery.filtered;MailQueue.notify;PutQueueRequest.notify.SpamRequest { block, reason?, force? },SpamResponse,BlocklistEntry,ListBlocklistQuery/Response,AddBlockRequest/Response,RemoveBlockResponse.unfiltered(migration 0111 rebuildsmail_ticket_eventsfor it).Review round 1: a person's action (reply, note, assign, status, escalate) or a genuine message from someone on the ticket clears
filtered; the hourly cap counts only DMARC-passing mail;X-Auto-Response-Suppressis no longer read; the default list hides filtered tickets only when no status, assignee or search is given; public suffixes and more shared providers cannot be domain-blocked; blocking an unverified sender is refused (domain) or needs--force(address);spamdefaults to--block none; the block and the status change are one batch.Test plan
bun run typecheck,bun run lintbackend/test/mail-screening.test.ts(38 tests: real D1, real postal-mime, Miniflare R2, real admin router, recording send binding)test/admin-mail-cli.test.ts(67 pass, 5 new), route inventory, ADR index, API export surfaceOperator step
After deploy:
nemar admin mail queues set '*' --notify false