aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-composer-utils.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2010-07-16 00:20:16 +0800
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-07-16 00:20:16 +0800
commit51a41db621693114f5ee60d48e7e6442fc85fcc4 (patch)
treea9db9c3a0d3258b4b73d603028f1e76a998fd82e /mail/em-composer-utils.c
parent21b0925061702c0c2a6ee30819c739409bba39d2 (diff)
downloadgsoc2013-evolution-51a41db621693114f5ee60d48e7e6442fc85fcc4.tar.gz
gsoc2013-evolution-51a41db621693114f5ee60d48e7e6442fc85fcc4.tar.zst
gsoc2013-evolution-51a41db621693114f5ee60d48e7e6442fc85fcc4.zip
Add nag popup when mailing list hijacks private reply with Reply-To: header
Diffstat (limited to 'mail/em-composer-utils.c')
-rw-r--r--mail/em-composer-utils.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 4bc91c65a0..d01a421013 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -1861,6 +1861,29 @@ em_utils_get_reply_sender (CamelMimeMessage *message, CamelInternetAddress *to,
}
static void
+get_reply_from (CamelMimeMessage *message, CamelInternetAddress *to, CamelNNTPAddress *postto)
+{
+ CamelInternetAddress *from;
+ const gchar *name, *addr, *posthdr;
+ gint i;
+
+ /* check whether there is a 'Newsgroups: ' header in there */
+ if (postto
+ && ((posthdr = camel_medium_get_header((CamelMedium *)message, "Followup-To"))
+ || (posthdr = camel_medium_get_header((CamelMedium *)message, "Newsgroups")))) {
+ camel_address_decode((CamelAddress *)postto, posthdr);
+ return;
+ }
+
+ from = camel_mime_message_get_from (message);
+
+ if (from) {
+ for (i = 0; camel_internet_address_get (from, i, &name, &addr); i++)
+ camel_internet_address_add (to, name, addr);
+ }
+}
+
+static void
concat_unique_addrs (CamelInternetAddress *dest, CamelInternetAddress *src, GHashTable *rcpt_hash)
{
const gchar *name, *addr;
@@ -2274,6 +2297,12 @@ em_utils_reply_to_message(CamelFolder *folder, const gchar *uid, CamelMimeMessag
flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_SEEN;
switch (mode) {
+ case REPLY_MODE_FROM:
+ if (folder)
+ postto = camel_nntp_address_new();
+
+ get_reply_from (message, to, postto);
+ break;
case REPLY_MODE_SENDER:
if (folder)
postto = camel_nntp_address_new();