when message is delivered, save whether it is from a mailing list; in webmail, show if message was a forward or mailing list, and don't enable requiretls when sending to a list.

This commit is contained in:
Mechiel Lukkien
2023-11-02 20:03:47 +01:00
parent 481a25f294
commit 0200e539a9
9 changed files with 47 additions and 20 deletions

View File

@ -1127,6 +1127,8 @@ type ComposeOptions = {
// Message is marked as replied/answered or forwarded after submitting, and
// In-Reply-To and References headers are added pointing to this message.
responseMessageID?: number
// Whether message is to a list, due to List-Id header.
isList?: boolean
}
interface ComposeView {
@ -1323,8 +1325,9 @@ const compose = (opts: ComposeOptions) => {
aborter.abort = undefined
v.recipientSecurity = rs
if (isRecipient) {
// If all recipients implement REQUIRETLS, we can enable it.
let reqtls = true
// If we are not replying to a message from a mailing list, and all recipients
// implement REQUIRETLS, we enable it.
let reqtls = opts.isList !== true
const walk = (l: AddrView[]) => {
for (const v of l) {
if (v.recipientSecurity?.RequireTLS !== api.SecurityResult.SecurityResultYes) {
@ -2223,6 +2226,7 @@ const newMsgView = (miv: MsgitemView, msglistView: MsglistView, listMailboxes: l
isForward: forward,
attachmentsMessageItem: forward ? mi : undefined,
responseMessageID: m.ID,
isList: m.IsMailingList,
}
if (all) {
opts.to = (to || []).concat((mi.Envelope.To || []).filter(a => !envelopeIdentity([a]))).map(a => formatAddress(a))