Queue messages for SMTP before encryption - #8619
Open
link2xt wants to merge 4 commits into
Open
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
link2xt
force-pushed
the
link2xt/late-encryption
branch
2 times, most recently
from
August 25, 2026 20:23
d688b11 to
6809578
Compare
link2xt
force-pushed
the
link2xt/create_send_msg_jobs-row_id
branch
from
August 26, 2026 14:36
e657a72 to
a67a5b0
Compare
link2xt
force-pushed
the
link2xt/late-encryption
branch
3 times, most recently
from
September 1, 2026 17:25
756d28c to
3d72fe8
Compare
link2xt
force-pushed
the
link2xt/late-encryption
branch
8 times, most recently
from
September 9, 2026 05:43
b838513 to
bdfd0d4
Compare
link2xt
added this pull request to stack #8677
September 9, 2026 06:13
link2xt
force-pushed
the
link2xt/late-encryption
branch
2 times, most recently
from
September 9, 2026 07:55
958c526 to
fe41960
Compare
It was incorrectly converting unused row ID to MsgId type and selecting already known msg_id.
This is similar to mimefactory::Encryption, but does not have email addresses for asymmetrically encrypted messages. Queued messages don't need email addresses for public keys. Addresses are only needed to render Autocrypt-Gossip headers.
link2xt
force-pushed
the
link2xt/late-encryption
branch
2 times, most recently
from
September 9, 2026 08:37
8a42d9b to
b9bba12
Compare
link2xt
removed this pull request from stack #8677
September 9, 2026 08:38
link2xt
force-pushed
the
link2xt/late-encryption
branch
2 times, most recently
from
September 9, 2026 10:11
3e8fdaa to
eb1c34c
Compare
Headers like From and Autocrypt are now added late, right before sending the message over SMTP. This way we advertise the latest list of transports and use the correct From address in the encrypted part even for messages queued while being offline. BCC-self recipients are also added late. 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
September 9, 2026 10:26
eb1c34c to
7eb324f
Compare
link2xt
marked this pull request as ready for review
September 9, 2026 10:27
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. Follow-up to #8345 in some way, this now uses
QueuedMailfor real.There is a python test that was previously failing, deleting the current transport while having messages queued.
Large number of lines added is because of better types (new
QueuedEncryptionseparate frommimefactory::Encryption) and duplicatedsmtp2table with documentation.Left for follow-up PRs:
chat::enqueue_mail. This needs refactoring location streaming code etc. that is unrelated.QueuedMail,QueuedEncryptionand related functions from mimefactory to a separate module.ConfiguredAddr.Note re 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.
Commit message
Headers like From and Autocrypt are now added late, right before sending the message over SMTP. This way we advertise the latest list of transports and use the correct From address in the encrypted part even for messages queued while being offline.BCC-self recipients are also added late.
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.