Start making it possible to write to mailing lists (#2736)

See #748, #1964 and 3ba4c6718e/draft/mailing_list_managers.md

Also fix #2735: Assign outgoing messages from other devices to the mailing list
This commit is contained in:
Hocuri
2021-12-31 14:01:30 +01:00
committed by GitHub
parent 246cae5d9e
commit 4136217249
7 changed files with 259 additions and 18 deletions

View File

@@ -2,7 +2,7 @@
use std::convert::TryInto;
use anyhow::{bail, ensure, format_err, Result};
use anyhow::{bail, ensure, format_err, Context as _, Result};
use chrono::TimeZone;
use lettre_email::{mime, Address, Header, MimeMultipartType, PartBuilder};
@@ -154,6 +154,12 @@ impl<'a> MimeFactory<'a> {
if chat.is_self_talk() {
recipients.push((from_displayname.to_string(), from_addr.to_string()));
} else if chat.is_mailing_list() {
let list_post = chat
.param
.get(Param::ListPost)
.context("Can't write to mailinglist without ListPost param")?;
recipients.push(("".to_string(), list_post.to_string()));
} else {
context
.sql