GNU bug report logs - #13329
24.2 post patch for #9521; Rmail forward does not correctly handle MIME messages containing "From " lines

Previous Next

Package: emacs;

Reported by: mdl <at> alum.mit.edu

Date: Tue, 1 Jan 2013 22:27:01 UTC

Severity: minor

Tags: moreinfo

Found in version 24.2

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#13329: closed (24.2 post patch for #9521; Rmail forward does
 not correctly handle MIME messages containing "From " lines)
Date: Wed, 10 Jan 2024 11:04:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 10 Jan 2024 03:03:22 -0800
with message-id <CADwFkm=W=2wk8DF4JA=2K0r5V1BWcodDwqFTnnHJ6iPBB7=k_Q <at> mail.gmail.com>
and subject line Re: bug#13329: 24.2 post patch for #9521; Rmail forward does not correctly handle MIME messages containing "From " lines
has caused the debbugs.gnu.org bug report #13329,
regarding 24.2 post patch for #9521; Rmail forward does not correctly handle MIME messages containing "From " lines
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
13329: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=13329
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mark Lillibridge <mdl <at> alum.mit.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2 post patch for #9521;
	Rmail forward does not correctly handle MIME messages containing
	"From " lines
Date: Tue, 01 Jan 2013 14:24:25 -0800
[Message part 3 (text/plain, inline)]
[|'s added to quote From lines]

    If you forward a Rmail message containing a MIME message with "From "
lines, the mbox escaping of From lines is not properly done.


    Start emacs -q then evaluate the 9521 patch:

(require 'rmailmm)

(defun rmail-insert-mime-forwarded-message (forward-buffer)
  "Insert the message in FORWARD-BUFFER as a forwarded message.
This is the usual value of `rmail-insert-mime-forwarded-message-function'."
  (let ((message-buffer
	 (with-current-buffer forward-buffer
	   (if rmail-buffer-swapped
	       rmail-view-buffer
	     forward-buffer))))
    (save-restriction
      (narrow-to-region (point) (point))
      (message-forward-make-body-mime message-buffer))))


    Then run Rmail on the following mbox file (remove |'s at line start
first):

|From mdl  Wed Oct 26 10:18:58 2011
|X-RMAIL-ATTRIBUTES: --EF----
|X-RMAIL-KEYWORDS: *
|X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED,
|	RP_MATCHES_RCVD autolearn=unavailable version=3.3.1
|From: Mark Lillibridge <mark.lillibridge <at> hp.com>
|To: <bug-gnu-emacs <at> gnu.org>
|Subject: 23.3; rmail-edit-current-message adds extra '>'s to Froms...
|Date: Sat, 22 Oct 2011 12:05:57 -0700
|Reply-To: <mark.lillibridge <at> hp.com>
|
|
|Start with a Rmail message (this one will do) not containing MIME that
|contains lines like the following:
|
|>From level 1
|>>From level 2
|>>>From level 3
|
|From mdl  Tue Jan  1 12:27:17 2013
|Delivered-To: lillibridge <at> gmail.com
|Received: from gmail-pop.l.google.com [74.125.25.108]
|	by foil.strangled.net with POP3 (fetchmail-6.3.18)
|	for <mdl <at> localhost> (single-drop); Tue, 01 Jan 2013 12:27:17 -0800 (PST)
|Received: by 10.49.49.9 with SMTP id q9csp680843qen;
|        Tue, 1 Jan 2013 12:27:08 -0800 (PST)
|X-Received: by 10.52.69.201 with SMTP id g9mr59443696vdu.98.1357072028236;
|        Tue, 01 Jan 2013 12:27:08 -0800 (PST)
|Return-Path: <mark.lillibridge <at> hp.com>
|Received: from alum-mailsec-relay-12.mit.edu (ALUM-MAILSEC-RELAY-12.MIT.EDU. [18.7.68.32])
|        by mx.google.com with ESMTPS id o8si46143160vdv.77.2013.01.01.12.27.08
|        (version=TLSv1/SSLv3 cipher=OTHER);
|        Tue, 01 Jan 2013 12:27:08 -0800 (PST)
|Received: from alum-mailsec-scanner-7.mit.edu (ALUM-MAILSEC-SCANNER-7.MIT.EDU [18.7.68.19])
|	by alum-mailsec-relay-12.mit.edu (8.13.8/8.12.8) with ESMTP id r01KR7kv027035
|	for <mdl <at> alum.mit.edu>; Tue, 1 Jan 2013 15:27:07 -0500
|Received: from madara.hpl.hp.com (madara.hpl.hp.com [192.6.19.124])
|	by alum-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id A5.53.02235.B9643E05; Tue,  1 Jan 2013 15:27:07 -0500 (EST)
|Received: from postal.hpl.hp.com (postal.hpl.hp.com [15.25.115.25])
|	by madara.hpl.hp.com (8.14.4/8.14.4/HPL-PA Relay) with ESMTP id r01KR5Ae021394
|	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
|	for <mdl <at> alum.mit.edu>; Tue, 1 Jan 2013 12:27:06 -0800
|Received: from build-debian-1.u.hpl.hp.com (build-debian-1.u.hpl.hp.com [15.8.240.3])
|	by postal.hpl.hp.com (8.14.3/8.14.3/HPL-PA Hub) with ESMTP id r01KR4Df022085;
|	Tue, 1 Jan 2013 12:27:04 -0800
|From: Mark Lillibridge <mark.lillibridge <at> hp.com>
|To: mdl <at> alum.mit.edu
|Subject: test message containing From's in an attachment
|Reply-to: mark.lillibridge <at> hp.com
|Date: Tue, 01 Jan 2013 12:27:04 -0800
|Message-ID: <qmhip7gmyxz.fsf <at> build-debian-1.u.hpl.hp.com>
|MIME-Version: 1.0
|Content-Type: text/plain
|Content-Disposition: attachment; filename=froms.txt
|X-RMAIL-ATTRIBUTES: ------U-
|
|>From level 1
|>>From level 2
|>>>From level 3
|
|From mdl  Tue Jan  1 13:04:30 2013
|Delivered-To: lillibridge <at> gmail.com
|Received: from gmail-pop.l.google.com [74.125.25.108]
|	by foil.strangled.net with POP3 (fetchmail-6.3.18)
|	for <mdl <at> localhost> (single-drop); Tue, 01 Jan 2013 13:04:30 -0800 (PST)
|Received: by 10.49.49.9 with SMTP id q9csp681694qen;
|        Tue, 1 Jan 2013 13:04:13 -0800 (PST)
|X-Received: by 10.52.75.100 with SMTP id b4mr59369212vdw.52.1357074253041;
|        Tue, 01 Jan 2013 13:04:13 -0800 (PST)
|Return-Path: <mark.lillibridge <at> hp.com>
|Received: from alum-mailsec-relay-12.mit.edu (ALUM-MAILSEC-RELAY-12.MIT.EDU. [18.7.68.32])
|        by mx.google.com with ESMTPS id u1si24918746vdh.137.2013.01.01.13.04.12
|        (version=TLSv1/SSLv3 cipher=OTHER);
|        Tue, 01 Jan 2013 13:04:13 -0800 (PST)
|Received: from alum-mailsec-scanner-3.mit.edu (ALUM-MAILSEC-SCANNER-3.MIT.EDU [18.7.68.14])
|	by alum-mailsec-relay-12.mit.edu (8.13.8/8.12.8) with ESMTP id r01L47Pu030367
|	for <mdl <at> alum.mit.edu>; Tue, 1 Jan 2013 16:04:12 -0500
|Authentication-Results: symauth.service.identifier
|Received: from madara.hpl.hp.com (madara.hpl.hp.com [192.6.19.124])
|	by alum-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP id E2.ED.02222.B4F43E05; Tue,  1 Jan 2013 16:04:12 -0500 (EST)
|Received: from masterns.hpl.hp.com (masterns.hpl.hp.com [15.0.48.4])
|	by madara.hpl.hp.com (8.14.4/8.14.4/HPL-PA Relay) with ESMTP id r01L4Auq022776
|	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
|	for <mdl <at> alum.mit.edu>; Tue, 1 Jan 2013 13:04:10 -0800
|Received: from build-debian-1.u.hpl.hp.com (build-debian-1.u.hpl.hp.com [15.8.240.3])
|	by masterns.hpl.hp.com (8.14.3/8.14.3/HPL-PA Hub) with ESMTP id r01L47j3018514;
|	Tue, 1 Jan 2013 13:04:08 -0800
|From: Mark Lillibridge <mark.lillibridge <at> hp.com>
|To: mdl <at> alum.mit.edu
|Subject: test message containing From's in an attachment
|Reply-to: mark.lillibridge <at> hp.com
|Date: Tue, 01 Jan 2013 13:04:07 -0800
|Message-ID: <qmhhan0mx88.fsf <at> build-debian-1.u.hpl.hp.com>
|MIME-Version: 1.0
|Content-Type: multipart/mixed; boundary="=-=-="
|X-RMAIL-ATTRIBUTES: --------
|
|--=-=-=
|Content-Type: text/plain
|
|
|body part
|
|
|--=-=-=
|Content-Type: text/plain
|Content-Disposition: attachment; filename=froms.txt
|
|>From level 1
|>>From level 2
|>>>From level 3
|
|--=-=-=--
|

    The result should be 3 messages.  If you forward any of the
messages, you'll see that the resulting message has the form:

|To: 
|...
|
|
[Message part 4 (message/rfc822, inline)]

|>From level 1
|>>From level 2
|>>>From level 3
|...
|
[Message part 5 (text/plain, inline)]
Note that the From lines should be under mboxrd:

|From level 1
|>From level 2
|>>From level 3


    See #13328 for related discussion of properly decoding From lines in
MIME messages.

- Mark
[Message part 6 (message/rfc822, inline)]
From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: mdl <at> alum.mit.edu, 13329-done <at> debbugs.gnu.org, larsi <at> gnus.org
Subject: Re: bug#13329: 24.2 post patch for #9521; Rmail forward does not
 correctly handle MIME messages containing "From " lines
Date: Wed, 10 Jan 2024 03:03:22 -0800
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: Mark Lillibridge <mdl <at> alum.mit.edu>
>>> Cc: eliz <at> gnu.org, larsi <at> gnus.org, 13329 <at> debbugs.gnu.org
>>> Date: Mon, 10 Oct 2022 14:04:58 -0700
>>>
>>> >      I was using Emacs Rmail, but not the pure emacs 28.1 -q because I
>>> >  need to change settings to send email.  Let me see if I can try a purer
>>> >  reenactment.
>>>
>>>     Ok, I sent myself a message with last line "From nothing" (pure text
>>> body); fetchmail produced the attached incoming_sample.gz file, which
>>> Rmail 'g' added to an empty Rmail file to produce the attached
>>> RMAIL.sample.gz.  I did this using as pure an Rmail set up as I can with
>>> emacs 28.1.  My sending/receiving goes through MIT email forwarding and
>>> uses Gmail as a receiving service.
>>>
>>>    Both of these files have the proper mbox quoting, with a > before the
>>> >From in the body.  If I switch to emacs 28.1 -q and open that Rmail
>>> file, I see the extra > and pressing 'f' includes it in the forwarded
>>> message.  This shows both bugs (13328 and 13329).
>>>
>>>    See if you can open RMAIL.sample and reproduce the bugs on your end.
>>> If so, something must differ between our email sending/receiving before
>>> rmail processes.  If you can't reproduce the bugs given the Rmail file,
>>> I'm very confused.
>>
>> So, to summarize:
>>
>>   . the problem happens only in emails that have MIME-Version: header
>>   . the problem happens only in emails that have just the body, no
>>     attachments
>>   . the problem happens because rmail-show-mime doesn't remove the ">"
>>     from ">From" when it shows the plan-text MIME content
>>
>> Is that correct?
>
> It seems like we need more information here in order to make any
> progress.  Mark, could you answer the questions above?
>
> Thanks in advance.

More information was requested, but none was given within 4 months, so
I'm closing this bug.

If this is still an issue, please reply to this email (use "Reply to
all" in your email client) and we can reopen the bug report.


This bug report was last modified 1 year and 127 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.