Two-way draft sync, signatures, sent/bcc fixes, and mail-list UI
Backend - Sent copies: persist locally on send + periodic multi-folder CONDSTORE poll (Sent/Archive/Trash/Junk) so they thread and show without an IDLE-only INBOX. - Bcc: transmitted copy omits Bcc, Sent copy keeps it; store/display bcc_addr. - Drafts: mirror local drafts to the IMAP Drafts folder (append/replace/expunge); inbound sync of foreign drafts (un-threaded) with adopt-to-edit + dedup by UID. - Per-user storage quota (5 GiB default) and manual "sync all folders" action. - Account editing (display/color/server/password) and per-account HTML signature. - Account view scoped to that account's inbox; new migrations 0006–0009. Frontend - Mail-list pagination, folder filters (All/Unread/Pinned), sort toggle, refresh. - Aligned + widened mail-list margins; reading-pane bars fixed height. - Rich-text composer: color palette, highlight, image; attachments; expand/pop-out. - Signatures: auto-insert for new mail, replace on From change, reply insert. - Restore/Delete actions per folder; drafts view merges local + remote, date-sorted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -49,8 +49,13 @@ def build_mime(
|
||||
draft: Draft,
|
||||
reply_to: Message | None,
|
||||
attachments: list[tuple[str, str, bytes]] | None = None,
|
||||
) -> tuple[bytes, str, list[str]]:
|
||||
"""Return ``(raw_rfc822, envelope_from, envelope_to)`` for ``draft``.
|
||||
) -> tuple[bytes, bytes, str, list[str]]:
|
||||
"""Return ``(transmit_raw, sent_raw, envelope_from, envelope_to)`` for ``draft``.
|
||||
|
||||
``transmit_raw`` is sent to the SMTP recipients and carries NO ``Bcc`` header.
|
||||
``sent_raw`` is the copy filed in Sent; it additionally includes a ``Bcc``
|
||||
header so the sender keeps a record of blind recipients (standard client
|
||||
behavior). They are identical when there is no Bcc.
|
||||
|
||||
``attachments`` is a list of ``(filename, mime_type, data)`` uploaded via the
|
||||
compose Attach action; each is added as a file attachment part.
|
||||
@@ -99,4 +104,10 @@ def build_mime(
|
||||
)
|
||||
|
||||
envelope_to = [_email_only(a) for a in (to + cc + bcc)]
|
||||
return msg.as_bytes(), account.email, envelope_to
|
||||
transmit_raw = msg.as_bytes() # no Bcc header -> safe to transmit
|
||||
if bcc:
|
||||
msg["Bcc"] = ", ".join(bcc)
|
||||
sent_raw = msg.as_bytes()
|
||||
else:
|
||||
sent_raw = transmit_raw
|
||||
return transmit_raw, sent_raw, account.email, envelope_to
|
||||
|
||||
Reference in New Issue
Block a user