From f836bed24997c679b99762ac81c8475110d29251 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 24 May 2002 06:37:30 +0000 Subject: If we can't find the mailing list address in the recipients list, just 2002-05-24 Jeffrey Stedfast * mail-callbacks.c (mail_generate_reply): If we can't find the mailing list address in the recipients list, just Reply-to-All instead. svn path=/trunk/; revision=16998 --- mail/mail-callbacks.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'mail/mail-callbacks.c') diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 21c6aea978..b232813ed3 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -888,6 +888,7 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char if (source) me = mail_config_get_account_by_source_url (source); + determine_recipients: if (mode == REPLY_LIST) { CamelMessageInfo *info; const char *mlist; @@ -897,9 +898,13 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char mlist = camel_message_info_mlist (info); if (mlist) { + EDestination *dest; + /* look through the recipients to find the *real* mailing list address */ len = strlen (mlist); + printf ("we are looking for the mailing list called: %s\n", mlist); + to_addrs = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO); max = camel_address_length (CAMEL_ADDRESS (to_addrs)); for (i = 0; i < max; i++) { @@ -919,13 +924,24 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char } if (address && i != max) { - EDestination *dest; - dest = e_destination_new (); e_destination_set_name (dest, name); e_destination_set_email (dest, address); to = g_list_append (to, dest); + } else { + /* mailing list address wasn't found */ + if (strchr (mlist, '@')) { + /* mlist string has an @, maybe it's valid? */ + dest = e_destination_new (); + e_destination_set_email (dest, mlist); + + to = g_list_append (to, dest); + } else { + /* give up and just reply to all recipients? */ + mode = REPLY_ALL; + goto determine_recipients; + } } } -- cgit v1.2.3