From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bill Wohler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67360: 29.1; MH-E forwarded email has a mangled default Subject header Date: Sat, 30 Dec 2023 14:05:29 -0800 Organization: Newt Software Message-ID: <1842253.1703973929@olgas.newt.com> References: <2330410.1700614164@apps0.cs.toronto.edu> <83il5thmsp.fsf@gnu.org> <117576.1701056977@alto> Reply-To: Bill Wohler 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="15541"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Chris Siebenmann , Eli Zaretskii , 67360@debbugs.gnu.org To: Mike Kupfer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 30 23:06:28 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 1rJhTO-0003mf-IH for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Dec 2023 23:06:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJhT1-00036X-4E; Sat, 30 Dec 2023 17:06:03 -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 1rJhSz-00036P-Lg for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 17:06:01 -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 1rJhSz-0008MB-Dk for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 17:06:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rJhSz-000146-P8 for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 17:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Bill Wohler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Dec 2023 22:06:01 +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.17039739444068 (code B ref 67360); Sat, 30 Dec 2023 22:06:01 +0000 Original-Received: (at 67360) by debbugs.gnu.org; 30 Dec 2023 22:05:44 +0000 Original-Received: from localhost ([127.0.0.1]:45176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJhSh-00013Y-WF for submit@debbugs.gnu.org; Sat, 30 Dec 2023 17:05:44 -0500 Original-Received: from se6c-iad1.servconfig.com ([173.231.241.24]:54455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJhSe-00013I-56 for 67360@debbugs.gnu.org; Sat, 30 Dec 2023 17:05:43 -0500 Original-Received: from ecbiz329.inmotionhosting.com ([209.182.198.38]) by se6-iad1.servconfig.com with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1rJhSV-00011t-20; Sat, 30 Dec 2023 17:05:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=newt.com; s=default; h=Message-ID:Date:Content-Transfer-Encoding:Content-ID: Content-Type:MIME-Version:References:In-reply-to:Subject:From:cc:To:Sender: Reply-To:Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=lfquItnC0dKTyLRG5kC5d9cVNpRZ4xsAkWs4PnLZAqM=; b=CZZQs63/9XnaRWP3MfrWxqgCkr 1iUTFlaV0XdYjz+2k8VHcf0+M+1UJ977bLAD5sKrOSEeFc/ciO0QeFZXfx9PI2W6m/Msw4j6MwDXN y7+bhlWybCSqLD3q6hNAh/78uUdzTvcnwTTZpsSAS8sqhmgi74E2ps2gbWqn2OxX9CjzQzQrw8hri 3JmcxoD/kbKOYUDW/3nUHR4rMmgNLxNecmbnMu3OJv7mKyxy6EFOXckXqdk7w89nNwNLifTv+e9+3 RN3J5qmRZBRxVnIRBvYd4RMgNNYx6r3O1/lV8XdRSga7ZisFRfLyYKgaiqebV8YT543Vk6WY7rcXf mXh9d3fQ==; Original-Received: from [24.4.147.188] (port=36890 helo=olgas.newt.com) by ecbiz329.inmotionhosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rJhSU-006HeL-0n; Sat, 30 Dec 2023 17:05:30 -0500 Original-Received: by olgas.newt.com (Postfix, from userid 1000) id 31110381F05; Sat, 30 Dec 2023 14:05:29 -0800 (PST) In-reply-to: <117576.1701056977@alto> Comments: In-reply-to Mike Kupfer message dated "Sun, 26 Nov 2023 19:49:37 -0800." X-Mailer: MH-E 8.6+git; nmh 1.8-RC2; Emacs 30.0.50 X-Image-URL: http://www.newt.com/wohler/images/bill-diving.png Content-ID: <1842252.1703973929.1@olgas.newt.com> X-Get-Message-Sender-Via: ecbiz329.inmotionhosting.com: authenticated_id: wohler@newt.com X-Authenticated-Sender: ecbiz329.inmotionhosting.com: wohler@newt.com X-Originating-IP: 209.182.198.38 X-SpamExperts-Domain: ecbiz329.inmotionhosting.com X-SpamExperts-Username: 209.182.198.38 Authentication-Results: servconfig.com; auth=pass smtp.auth=209.182.198.38@ecbiz329.inmotionhosting.com X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.10) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT9i2vNgAiGutxFrqRwvGbEoPUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5wPNj8CRzrsGB7ugNp6dkMIG6S2l0Sq0XyAP7CL22R+h7Qy nBdRnGcStIJd2ozIafxMBhQwZ4U+dP0cDUdUHxwFkzGIyEDKB5+tuM/BiYkNNtjLQNCIemmyp7tp LvZV4fGqkaWbbOMJrh1zQUl46B+CBBBG5qGJPMemR9//pDmr0QK/NzaQ0kU5LIjXaSmvljzrv6uv y67bPy9KnwerIPD7+EJh3GmpTMtirFB1CX1Gmfdp637QXBUN6CLyeuzX+S3o06Pbn32ePf/zaJyv Vrl2ffwjk2dD8fHm6GckUr6uGMCGpH6KPvCaPYMwmktYRls2JrO8Qv8RArq2MwWaNnh+UuIF2yn0 3s7TS3ghm2vgBpb5Pn6ftQZVK9K8EAjn37sUg69eDYNe2itClT3S7bjQUCo5PZJsLcY5FmNhp+JD xofgBwPJRy2KP3xL3XdLYqV41APOGyRuqKbOun7vlQzhwfhpspQKRAIBFcUdSV85+USmicW4BKeo lukxoVI4SaNoMMMh30z0ou3Uma6ICBqohxGGNNFI1AuNleg/0I92t9xCHahZfsjvoDKdqQReE7op ol7/zxbDwFIVzeFgpWdBcxw3qqhc+N6cuEg4XWh5Fq9D8y81M79IYqpO94EpO3IPWHrVi9hSq7ds FoctQMdxVYl+ooxaD+3vSXb9kO06f9m0ZFmyUDLBGs3sQM5xYpEkNFI/tMRrMWPNph6/qaBnaL3D 5sbF+pWUUp/BhR8+AAGEl7PZ0dsWG X-Report-Abuse-To: spam@se1-lax1.servconfig.com 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:277104 Archived-At: Thanks, Mike! My forwcomps only injects one header field so I never saw this before. Uncommenting the Subject field made it possible to reproduce this issue. Yes, I agree that the code clearly wants to replace the Subject field, not append to it, and this patch works for me as well. Please feel free to commit the patch and resolve the issue. Thanks again! Mike Kupfer wrote: > 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 = will > > > be manged and come out as, for example: > > > = > > > Subject: test forwarding subject (fwd) Chris Siebenmann: test forwa= rding subject > [...] > > > I suspect that the intention is to replace any existing Subject:, or > > > perhaps mh-forward assumes that the draft won't have one. Unfortunat= ely > > > for mh-forward, mh-insert-fields is specifically documented to *appe= nd* > > > to the existing header field value, if there is one, not overwrite i= t, > > > so the resulting Subject: of the draft is as we see here: the origin= al > > > subject created by 'forw', and then an appended Subject from mh-forw= ard. > > > 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= what 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, f= or > > > 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 Retu= rn > > > * start to forward with 'f' or 'M-x mh-forward'. > = > mike > = -- = Bill Wohler aka http://www.newt.com/wohler/, GnuPG ID:610BD9AD