WIP: Late encryption - #8619
Draft
link2xt wants to merge 5 commits into
Draft
Conversation
link2xt
force-pushed
the
link2xt/late-encryption
branch
2 times, most recently
from
August 25, 2026 17:11
026e72d to
ce56911
Compare
link2xt
changed the base branch from
main
to
link2xt/create_send_msg_jobs-row_id
August 25, 2026 17:14
It was incorrectly converting unused row ID to MsgId type and selecting already known msg_id.
link2xt
force-pushed
the
link2xt/late-encryption
branch
from
August 25, 2026 19:51
ce56911 to
1fe0683
Compare
For unencrypted messages we only want to send a copy to the sending address, but we don't know the sending address when queueing the message. Adding bcc-self recipients when dequeuing the message also makes it possible to send copies to updated list of relays.
link2xt
force-pushed
the
link2xt/late-encryption
branch
from
August 25, 2026 20:23
d688b11 to
6809578
Compare
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.
Part of #8607, this removes the code that deletes the whole queue when the sending relay is changed, and makes queueing the mail independent of the sending address. Sending address is decided later in SMTP loop (and in various testing utils that emulate sending).
Follow-up to #8345 in some way, this now uses
QueuedMailfor real.Based on #8585
Not yet ready for review as i want to cleanup some things (TODOs/FIXMEs), group SQL into a transaction.
As for performance of encryption: maybe it even makes UI more responsive because the message bubble can appear on the sending side faster as the message does not need to be encrypted yet.
There is likely some overlap with key updates as it may need another column to disable intended recipient fingerprints if key updates are asymmetrically encrypted and signed, i'll rebase this change later if needed or worst case there is another migration to add column to
smtp2. Or maybe key updates are generated on the fly and do not go into SMTP queue similarly to MDNs, and then there is no problem with the table structure.