From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mike Kupfer Newsgroups: gmane.emacs.bugs Subject: bug#67360: 29.1; MH-E forwarded email has a mangled default Subject header Date: Sun, 26 Nov 2023 19:49:37 -0800 Message-ID: <117576.1701056977@alto> References: <2330410.1700614164@apps0.cs.toronto.edu> <83il5thmsp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19778"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67360@debbugs.gnu.org, Bill Wohler To: Eli Zaretskii , Chris Siebenmann Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 27 04:51:39 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r7Sep-0004zl-ME for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Nov 2023 04:51:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7SeA-0005Ra-8G; Sun, 26 Nov 2023 22:50:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r7Se9-0005RS-Ba for bug-gnu-emacs@gnu.org; Sun, 26 Nov 2023 22:50:57 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r7Se9-0001rl-3M for bug-gnu-emacs@gnu.org; Sun, 26 Nov 2023 22:50:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r7SeE-0006Ml-Fs for bug-gnu-emacs@gnu.org; Sun, 26 Nov 2023 22:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mike Kupfer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Nov 2023 03:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67360 X-GNU-PR-Package: emacs Original-Received: via spool by 67360-submit@debbugs.gnu.org id=B67360.170105700724410 (code B ref 67360); Mon, 27 Nov 2023 03:51:02 +0000 Original-Received: (at 67360) by debbugs.gnu.org; 27 Nov 2023 03:50:07 +0000 Original-Received: from localhost ([127.0.0.1]:43049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7SdK-0006Le-Ry for submit@debbugs.gnu.org; Sun, 26 Nov 2023 22:50:07 -0500 Original-Received: from shell1.rawbw.com ([198.144.192.42]:52527 ident=root) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7SdH-0006LA-1t for 67360@debbugs.gnu.org; Sun, 26 Nov 2023 22:50:05 -0500 Original-Received: from alto (135-180-173-181.dsl.dynamic.sonic.net [135.180.173.181] (may be forged)) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id 3AR3nbQo093603 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 26 Nov 2023 19:49:43 -0800 (PST) (envelope-from kupfer@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host 135-180-173-181.dsl.dynamic.sonic.net [135.180.173.181] (may be forged) claimed to be alto In-reply-to: <83il5thmsp.fsf@gnu.org> Comments: In-reply-to Eli Zaretskii message dated "Wed, 22 Nov 2023 16:42:30 +0200." X-Mailer: MH-E 8.6+git; nmh 1.7.1; Emacs 29.1.90 Content-ID: <117575.1701056977.1@alto> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275101 Archived-At: Eli Zaretskii wrote: > > From: Chris Siebenmann > > Date: Tue, 21 Nov 2023 19:49:24 -0500 > > = > > If you attempt to forward an email message in MH-E with mh-forward > > (bound to eg 'f'), then the resulting Subject: of the draft message wi= ll > > be manged and come out as, for example: > > = > > Subject: test forwarding subject (fwd) Chris Siebenmann: test forward= ing subject [...] > > I suspect that the intention is to replace any existing Subject:, or > > perhaps mh-forward assumes that the draft won't have one. Unfortunatel= y > > for mh-forward, mh-insert-fields is specifically documented to *append= * > > to the existing header field value, if there is one, not overwrite it, > > so the resulting Subject: of the draft is as we see here: the original > > subject created by 'forw', and then an appended Subject from mh-forwar= d. > > This result is not terribly useful. Indeed. Yeah, mh-insert-fields seems like the wrong choice for Subject. It's more suited for headers like To or Cc, when you might want to add to the existing list of recipients. Replacing mh-insert-fields with mh-modify-header-field works for me. diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index 92d31bf1826..0d1dcdf626a 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el @@ -574,7 +574,7 @@ mh-forward (setq orig-subject (mh-get-header-field "Subject:"))) (let ((forw-subject (mh-forwarded-letter-subject orig-from orig-subject))) - (mh-insert-fields "Subject:" forw-subject) + (mh-modify-header-field "Subject" forw-subject t) (goto-char (point-min)) ;; Set the local value of mh-mail-header-separator according to w= hat is ;; present in the buffer... > > Reproduction in emacs -Q provided you have NMH and MH-E set up: > > * enter MH-E with 'M-x mh-rmail' > > * arrange to have some message in your inbox that you can forward, for > > example by 'F r' to see all of your inbox. Hide your personal forwcomps if you have one. > > * display your test message to forward, eg cursor to it and hit Return > > * start to forward with 'f' or 'M-x mh-forward'. mike