Subject: bug#13321: 24.3.0.50; Gmail error when replying from Gnus to github

From: Thierry Volpiatto <[email-masked]>
Date: Fri, 22 Feb 2013 08:33:52 +0100

Hi Katsumi,

Katsumi Yamaoka <[email-masked]> writes:

> Thierry Volpiatto wrote:
>> Here the commit that introduce this bug:
>> 2559724 *
>>| Author: Katsumi Yamaoka <[email-masked]>
>>| Date:   Mon Nov 19 06:24:03 2012 +0000
>>|
>>|     message.el (message-get-reply-headers): Make sure the reply goes to the author if it is a wide reply
>
> This log message suggested that the author (i.e., the From: address)
> of a mail didn't appear in a message header when starting composing
> a wide reply.  I mean, if you perform a wide reply using the `F' or
> the `S W' command to a mail like the following:
>
> From: [email-masked]
> To: [email-masked]
> Cc: [email-masked]
> Reply-To: [email-masked]
>
> The old one will compose a draft as follows:
>
> To: [email-masked]
> Cc: [email-masked]
>
> But the present one does:
>
> To: [email-masked]
> Cc: [email-masked], [email-masked]
>
> This is much better for a wide reply, isn't it?  The root cause of
> this difference is due to the Reply-To header, that some mailing
> list servers are likely to add (it may be because many mail clients
> compose a draft to send to only the author, I guess).
>
> Is your problem that the From address is invalid?
Yes.

> If so, if there is a valid Reply-To header, you can use R rather than
> F.

Anyway even when hitting "F" this shouldn't happen.

> Otherwise, feel free to forward an example mail to me.
Will (re)send in next post.

Here a patch that fix the problem, please review, I am not familiar with
all these mails headers.
Note that the second when clause is not needed when setting author
before, and don't corrupt further the "to" header when wide is not used.

Also my english is not very good, but I don't understand your comments,
please fix it (I leave long lines to see better).

Thanks.

diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 808e1ed..8b9df3c 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -6720,17 +6720,17 @@ The function is called with one parameter, a cons cell ..."
 			       ", "))
 	    mct (message-fetch-field "mail-copies-to")
 	    author (or (message-fetch-field "mail-reply-to")
-		       (message-fetch-field "reply-to"))
+		       (message-fetch-field "reply-to")
+                       (message-fetch-field "from")
+                       "")
 	    mft (and message-use-mail-followup-to
 		     (message-fetch-field "mail-followup-to")))
       ;; Make sure this message goes to the author if this is a wide
-      ;; reply, since Reply-To address may be a list address a mailing
-      ;; list server added.
+      ;; reply, FIXME: please fix the commented line following, it seem the second one is good and the first one wrong.
+      ;; since Reply-To address may be a list address a mailing list server added.
+      ;; since Reply-to adress may be a mailing list address with server added.
       (when (and wide author)
-	(setq cc (concat author ", " cc)))
-      (when (or wide (not author))
-	(setq author (or (message-fetch-field "from") ""))))
-
+	(setq cc (concat author ", " cc))))
     ;; Handle special values of Mail-Copies-To.
     (when mct
       (cond ((or (equal (downcase mct) "never")

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997