Repository navigation
Conversation
…eplied, List-Post, schema.org and calendar method An alias the owner removes from config stopped counting nowhere: ownAddresses joined the stored mail_own_addresses with the configured list, and settleOwnMail wrote the union back. The sync now keeps the configured list under mail_own_configured. An address that left it and has no live mail in Sent leaves mail_own_addresses, its mail outside Sent is incoming again (markOwnMail `removed`), and its email identity leaves the owner when the rules joined it. The owner's own link stays. Part of #3321. Mail sync keeps in emails.headers what #3358 listed as not stored, with no store version: - auto-replied: a signed Auto-Submitted: auto-replied, apart from auto-submitted, so an out-of-office makes no bot; - list-post: List-Post naming where to post (not NO); - schema-types and schema-fields: the schema.org type names (at most 10) and orderNumber, orderStatus, trackingNumber, reservationNumber, reservationStatus, never the HTML; - calendar-method: the text/calendar part's method. The classifier reads them: auto-replied is auto_reply, List-Id mail with List-Post and no campaign marker is a discussion_list, and stored schema types count as body_html's do. The JSON-LD opener regex no longer rescans a run of `<script` to the end, now that parseMail runs it on every mail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ports drop nothing A sync that passes no MailAccount.addresses, and an mbox import, must not read as the owner removing every alias. Removal now runs only when the caller gives the whole list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been 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.
Task
Why
ownAddressesjoined the storedmail_own_addresseswith the configured list, andsettleOwnMailwrote the union back. Afterconfig unset aliases, the address stayed the owner's for good: its mail stayed outgoing and its person stayed joined to the owner.Auto-Submitted: auto-repliedwas found by its subject only. A discussion list needed three stored senders. Synced mail kept no schema.org markup (the store keeps no HTML of synced mail) and no calendar method.What
Removed aliases (
src/mail/own.ts,src/store/sqlite/email-state.ts)MailAccount.addressesis now the whole list. A sync without it, and an mbox import, drop nothing: a caller that does not know every alias removes none.mail_own_configured.mail_own_addresses.label:Sent, is incoming again (markOwnMailtakesremoved).account, byrules). A link the owner made stays.mail_own_configuredtreats every stored address as possibly configured, once. On that first run, an address vouched for only by a Sent folder the run does not read is dropped.settleOwnMailtakesconfiguredin its options.Signals kept in
emails.headers(no store version, the same path as #3379)auto-replied: true: a signedAuto-Submitted: auto-replied, under the DKIM ruleprogramSignalsOfuses. It is not underauto-submitted, because bot detection and reach read that key, and a person's out-of-office must not make them a bot.list-post: true: List-Post names where to post, and does not sayNO(RFC 2369). Kept unsigned, like List-Id.schema-types: the schema.org type names from JSON-LD or microdata, at most 10.schema-fields: the firstorderNumber,orderStatus,trackingNumber,reservationNumberandreservationStatus, up to 100 characters each. Never the HTML.calendar-method: the method of thetext/calendarpart (request,cancel,reply), from the Content-Type parameter or the part'sMETHODline.parseMail(src/mail/body-signals.ts) and merged inparsedEmailandretry.ts, so sync, partial completion, whole reads and server search all keep them.Classifier
auto-replied→auto_reply(signalauto-replied).list-post, no Feedback-ID and no one-click unsubscribe →discussion_list(signallist-post), before three senders are stored.schema-typescount as the types of a keptbody_html.calendar-methodis stored only. No type reads it yet.Perf fix on the way:
JSON_LD_OPENwas<script[^>]*…, which rescans a run of<scriptwith no>to the end.parseMailnow runs it on every email, and the 200k hostile-HTML test inparse.test.tstook 5 s. It is now[^<>]*.Mail stored earlier gets none of these keys until mail sync reads it again.
Downstream: mail-cli gets this with the next cli-core release and its bump. The Gmail sendAs part of #3321 is WireCatLabs/mail-cli#208. Its
messages sendpath passes the saved send-as list, because a given list is now treated as complete.Testing
src/mail/own.test.ts: no list and an mbox import drop nothing; a removed alias (its mail is incoming, no tie, the identity is off the owner); a removed alias still in Sent stays the owner's; the owner's manual link survives; a store withoutmail_own_configured.src/mail/headers.test.ts: signed auto-replied kept apart; List-Post kept,NOdropped.src/mail/mail-types.test.ts:list-post,list-postwith Feedback-ID,auto-replied.src/store/mail-types.test.ts: an end-to-end sync keeps all five signals, no<scriptin the headers, and types the mail order, shipping, calendar, auto_reply and discussion_list.pnpm typecheck,biome check ., andsrc/mailplus the store mail tests with one worker (37 files, 371 tests). Alsodocs-check,check-distandcli-dev api-report(no API change).🤖 Generated with Claude Code