Skip to content

WIP: Late encryption - #8619

Draft
link2xt wants to merge 7 commits into
mainfrom
link2xt/late-encryption
Draft

WIP: Late encryption#8619
link2xt wants to merge 7 commits into
mainfrom
link2xt/late-encryption

Conversation

@link2xt

@link2xt link2xt commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

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 QueuedMail for 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.

@link2xt
link2xt force-pushed the link2xt/late-encryption branch from 02bf655 to 026e72d Compare August 23, 2026 02:40
.execute() was returning the number of rows, so usually 1.
.insert() is returning the row ID.

In most cases it does not matter because the result is checked with .is_empty(),
but send_msg_sync() actually uses the row IDs.
@link2xt
link2xt force-pushed the link2xt/late-encryption branch from 026e72d to ce56911 Compare August 25, 2026 17:11
@link2xt
link2xt changed the base branch from main to link2xt/create_send_msg_jobs-row_id August 25, 2026 17:14
@link2xt
link2xt force-pushed the link2xt/late-encryption branch from ce56911 to 1fe0683 Compare August 25, 2026 19:51
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
link2xt force-pushed the link2xt/late-encryption branch from d688b11 to 6809578 Compare August 25, 2026 20:23
@link2xt
link2xt force-pushed the link2xt/create_send_msg_jobs-row_id branch from e657a72 to a67a5b0 Compare August 26, 2026 14:36
Base automatically changed from link2xt/create_send_msg_jobs-row_id to main August 26, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant