Subject: Re: bug#79307: 30.1; Rmail: MIME decoding failed

From: Robert Pluim <[email-masked]>
Date: Tue, 26 Aug 2025 15:39:00 +0200

>>>>> On Mon, 25 Aug 2025 11:51:46 +0200, Francesco Potortì <[email-masked]> said:

    Francesco> Rmail says: "MIME decoding failed: (error Message is not a valid RFC 822 (or later) message)" when reading the attached mbox.  Apart from the error message, everything looks ok at first alright.  Sorry, no time to look at it at this the moment.
    Francesco> To reproduce:
    Francesco> - save the attachment
    Francesco> - emacs -Q
    Francesco> - C-u M-x rmail RET
    Francesco> - the name of the saved attachment RET

    Francesco> For me, Rmail apparently does the right thing, but prints the above error message.

The issue is that the message in question is a digest, and rmail tries
to copy out the headers from the component parts using
`rmail-copy-headers', but the first part looks like this:

---begin--
--cc57bd385044d4e75b21e375607f07ba

Content-Type: text/plain

debian-changes-digest Digest				Volume 2025 : Issue 139

--end--

Which doesnʼt match rmailʼs expectations of it starting with a "From"
line before the headers, hence rmail.el:2917 calls
`rmail-error-bad-format'.

Iʼm not sure how to fix this. We could just say 'if not looking at
"^[a-z-A-Z-"]+:", move forward one line', I guess.

Robert
--