Subject: Re: bug#9392: 24.0.50; rmail-forward produces messages in unsupported format that cannot be customized away

From: Eli Zaretskii <[email-masked]>
Date: Fri, 02 Sep 2011 13:46:31 +0300

> Date: Tue, 30 Aug 2011 01:47:06 -0400
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked]
> 
> > From: Kenichi Handa <[email-masked]>
> > Cc: [email-masked]
> > Date: Tue, 30 Aug 2011 09:36:08 +0900
> > 
> > My last changes to rmail.el and rmailmm.el were before the
> > release of 23.3, and for 23.3, I surely tested that
> > rmail-forward worked with "emacs -Q" (but I must confess that I
> > forgot to test the other configuration).
> > 
> > > AFAICS, the #part tag is not inserted because rmail-forward
> > > expects rmail-start-mail return a non-nil value, but with
> > > message-user-agent it returns nil.
> > 
> > So, It seems that something has been changed after the
> > release of 23.3.
> 
> You are right, it works in Emacs 23.3 with message-user-agent.  So
> this part (of rmail-forward not working in 'emacs -Q") is a recent
> regression.

The reason for this regression is this change in message.el:

 2011-02-03  Julien Danjou  <[email-masked]>

	 * message.el (message-setup-1): Always generate References first.
	 (message-mail): Return the return value of message-setup, not always t.
	 (message-setup-1): Insert mail-header-separator with read-only and
	 intangible properties set.

I don't know what was the rationale for this change, because if
message-setup calls message-setup-1, it will still return nil, since
message-setup-1 returns nil unconditionally.  The simple patch below
fixes this particular regression.

However, rmail-forward is still broken if mail-user-agent is set to
sendmail-user-agent.  That is a separate issue.  So please do not
close this bug, even if this patch is accepted by the Gnus developers.

Here's the patch to message.el to restore the Emacs 23.3 default
behavior of rmail-forward:

=== modified file 'lisp/gnus/message.el'
--- lisp/gnus/message.el	2011-08-20 00:20:39 +0000
+++ lisp/gnus/message.el	2011-09-02 09:45:18 +0000
@@ -6530,7 +6530,9 @@ are not included."
   (message-position-point)
   ;; Allow correct handling of `message-checksum' in `message-yank-original':
   (set-buffer-modified-p nil)
-  (undo-boundary))
+  (undo-boundary)
+  ;; rmail-start-mail expects message-mail to return t (Bug#9392)
+  t)
 
 (defun message-set-auto-save-file-name ()
   "Associate the message buffer with a file in the drafts directory."