core: send processed mail after filters instead of original

pull/1/head
Manos Pitsidianakis 2022-05-10 00:20:24 +03:00
parent 2f939cb104
commit 8ba1408822
2 changed files with 4 additions and 1 deletions

View File

@ -570,9 +570,10 @@ impl Database {
trace!("result {:#?}", result);
let Post { bytes, action, .. } = post;
let post_env = melib::Envelope::from_bytes(&bytes, None)?;
match action {
PostAction::Accept => {
let _post_pk = self.insert_post(list_ctx.list.pk, raw, env)?;
let _post_pk = self.insert_post(list_ctx.list.pk, &bytes, &post_env)?;
for job in list_ctx.scheduled_jobs.iter() {
if let crate::mail::MailJob::Send { recipients } = job {
if !recipients.is_empty() {

View File

@ -109,7 +109,9 @@ impl PostFilter for AddListHeaders {
trace!("Running AddListHeaders filter");
let (mut headers, body) = melib::email::parser::mail(&post.bytes).unwrap();
let list_id = ctx.list.list_id();
let reply_to = format!("<{}>", ctx.list.address);
headers.push((&b"List-ID"[..], list_id.as_bytes()));
headers.push((&b"Reply-To"[..], reply_to.as_bytes()));
let list_post = ctx.list.list_post();
let list_unsubscribe = ctx.list.list_unsubscribe();
let list_archive = ctx.list.list_archive();