[Xfce4-commits] <postler:master> Unset Reply-To if equal to List-Post, From or To

Christian Dywan noreply at xfce.org
Tue Jul 13 00:54:04 CEST 2010


Updating branch refs/heads/master
         to c7f72677184d78dc5c8d2e08420bd7d7df718985 (commit)
       from 4165cf1443e4e90d936b91981bd8fe35367cc951 (commit)

commit c7f72677184d78dc5c8d2e08420bd7d7df718985
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Jul 3 21:00:19 2010 +0200

    Unset Reply-To if equal to List-Post, From or To

 postler/postler-content.vala |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index 920a764..a098f8a 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -367,6 +367,7 @@ public class Postler.Content : WebKit.WebView {
             carbon_copy = "";
             /* TODO: blind_copy, some clients keep it */
             reply = "";
+            string list_post = "";
             organization = "";
             x_mailer = "";
             string previous_line = "";
@@ -410,6 +411,10 @@ public class Postler.Content : WebKit.WebView {
                     string reply_charset = null;
                     reply = parse_encoded (parts[1], out reply_charset);
                 }
+                else if (field == "list-post") {
+                    string list_post_charset = null;
+                    list_post = parse_encoded (parts[1], out list_post_charset);
+                }
                 else if (field == "organization")
                     organization = parts[1];
                 else if (field == "x-mailer" || field == "user-agent")
@@ -419,6 +424,20 @@ public class Postler.Content : WebKit.WebView {
             if (charset == null)
                 charset = default_charset;
 
+            /* Some mailing list systems override Reply-To so that it doesn't
+               point to the author but the list.
+               Also Reply-To may equal From, which is at best confusing. */
+            if (reply != "") {
+                string canonical = Postler.Messages.parse_address (reply)[1];
+                if (canonical == Postler.Messages.parse_address (recipient)[1])
+                    reply = "";
+                else if (list_post != ""
+                  && canonical == Postler.Messages.parse_address (list_post)[1])
+                    reply = "";
+                else if (canonical == Postler.Messages.parse_address (from)[1])
+                    reply = "";
+            }
+
             reply_to = reply != "" ? reply : from;
             if (carbon_copy != "")
                 reply_to_all = reply_to + "," + carbon_copy;



More information about the Xfce4-commits mailing list