Bug 1392371 - Add pref mail.override_list_reply_to to restore reply-to behaviour. r=aceman a=jorgk
authorJorg K <jorgk@jorgk.com>
Sun, 27 Aug 2017 09:01:48 +0200
changeset 28580 4d524fd73bc2f91a6cc5ac71f7945c7f3b1d3e32
parent 28579 a4e53b458b64d08c47a5b37a2d5fddf8f454027c
child 28581 fefd9ab5f8af4619d7d63f833223d7a5571a30cc
push id2008
push usermozilla@jorgk.com
push dateMon, 04 Sep 2017 10:24:18 +0000
treeherdercomm-beta@a64bcaaa03c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman, jorgk
bugs1392371
Bug 1392371 - Add pref mail.override_list_reply_to to restore reply-to behaviour. r=aceman a=jorgk
mailnews/compose/src/nsMsgCompose.cpp
mailnews/mailnews.js
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -2501,16 +2501,19 @@ NS_IMETHODIMP QuotingOutputStreamListene
 
   MSG_ComposeType type;
   compose->GetType(&type);
 
   // Assign cite information if available...
   if (!mCiteReference.IsEmpty())
     compose->SetCiteReference(mCiteReference);
 
+  bool overrideReplyTo =
+    mozilla::Preferences::GetBool("mail.override_list_reply_to", true);
+
   if (mHeaders && (type == nsIMsgCompType::Reply ||
                    type == nsIMsgCompType::ReplyAll ||
                    type == nsIMsgCompType::ReplyToList ||
                    type == nsIMsgCompType::ReplyToSender ||
                    type == nsIMsgCompType::ReplyToGroup ||
                    type == nsIMsgCompType::ReplyToSenderAndGroup) &&
       mQuoteOriginal)
   {
@@ -2749,17 +2752,18 @@ NS_IMETHODIMP QuotingOutputStreamListene
           // handle Mail-Reply-To (http://cr.yp.to/proto/replyto.html)
           compFields->SetTo(mailReplyTo);
           needToRemoveDup = true;
         }
         else if (!replyTo.IsEmpty())
         {
           // default reply behaviour then
 
-          if (!listPost.IsEmpty() && replyTo.Find(listPost) != kNotFound)
+          if (overrideReplyTo &&
+              !listPost.IsEmpty() && replyTo.Find(listPost) != kNotFound)
           {
             // Reply-To munging in this list post. Reply to From instead,
             // as the user can choose Reply List if that's what he wants.
             compFields->SetTo(from);
           }
           else
           {
             compFields->SetTo(replyTo);
@@ -2794,17 +2798,18 @@ NS_IMETHODIMP QuotingOutputStreamListene
         else if (mailFollowupTo.IsEmpty()) {
           // default reply-all behaviour then
 
           nsAutoString allTo;
           if (!replyTo.IsEmpty())
           {
             allTo.Assign(replyTo);
             needToRemoveDup = true;
-            if (!listPost.IsEmpty() && replyTo.Find(listPost) != kNotFound)
+            if (overrideReplyTo &&
+                !listPost.IsEmpty() && replyTo.Find(listPost) != kNotFound)
             {
               // Reply-To munging in this list. Add From to recipients, it's the
               // lesser evil...
               allTo.AppendLiteral(", ");
               allTo.Append(from);
             }
           }
           else
--- a/mailnews/mailnews.js
+++ b/mailnews/mailnews.js
@@ -9,16 +9,20 @@ pref("mail.advance_on_spacebar", true);
 //mailnews.timeline_is_enabled should be set to true ONLY for perf measurement-timeline builds.
 pref("mailnews.timeline_is_enabled", false);
 
 pref("mailnews.logComposePerformance", false);
 
 pref("mail.wrap_long_lines",                true);
 pref("mail.inline_attachments",             true);
 pref("mail.reply_quote_inline",             false);
+// When in a message the List-Post header contains the content of the Reply-To
+// (which is called "Reply-To Munging") we override the Reply-To header with
+// the From header.
+pref("mail.override_list_reply_to", true);
 
 // hidden pref for controlling if the user agent string
 // is displayed in the message pane or not...
 pref("mailnews.headers.showUserAgent",       false);
 
 // hidden pref for controlling if the organization string
 // is displayed in the message pane or not...
 pref("mailnews.headers.showOrganization",    false);