summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-06-24 23:59:45 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-06-25 10:37:19 +0300
commitf33594fba86d18cefa81bb7d64cc7b7357a9e8c6 (patch)
tree53c9a7a88073c80ca0a6210f9b137de28c0c644e
parentf4f3b87f849dcbccaf723c3a424f6f33a8a6201f (diff)
melib: reply to In-Reply-To address if available
-rw-r--r--melib/src/email/compose.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/melib/src/email/compose.rs b/melib/src/email/compose.rs
index af785cc2..6c67db00 100644
--- a/melib/src/email/compose.rs
+++ b/melib/src/email/compose.rs
@@ -155,8 +155,12 @@ impl Draft {
ret.headers_mut()
.insert("In-Reply-To".into(), envelope.message_id_display().into());
ret.header_order.push("In-Reply-To".into());
- ret.headers_mut()
- .insert("To".into(), envelope.field_from_to_string());
+ if let Some(reply_to) = envelope.other_headers().get("Reply-To") {
+ ret.headers_mut().insert("To".into(), reply_to.to_string());
+ } else {
+ ret.headers_mut()
+ .insert("To".into(), envelope.field_from_to_string());
+ }
ret.headers_mut()
.insert("Cc".into(), envelope.field_cc_to_string());
let body = envelope.body_bytes(bytes);