On Fri, Feb 20, 2026 at 01:50:59PM +0100, Olaf Hering via Mutt-dev wrote:
I would like to relay the body of an existing email, which should be
ready to use with its 'multipart/mixed;boundary="_something_";' container.
So I created a draft file for the -H option with headers MIME-Version,
Content-Type, Content-Disposition and the ready-to-use body. But for
some reason there is a call to mutt_remove_multipart_mixed in
mutt_prepare_template, and as a result there is data loss in the mail.
(I think this is the reason why it does not work)

I wonder what the rationale for that is? The commit messages from 2019
mean nothing to me.

This goes back, way before 2019. The commit in 2019 just added some support for multipart/alternative and renamed the functions.

The rationale is that mutt, as a MUA, always wants to generate the email for you.

When working with a draft file, Mutt removes the mixed container, if present, and takes out the pieces, and later assembles the email itself in a way it understands. In particular, Mutt only supports a "flat" structure, with minor support for multipart/alternative. Nested stuff is very likely not to survive how you want.

There is no pass-through mode for draft files, because Mutt can't properly generate or modify the email if it doesn't understand the parts.

Should there be a way for a user to prepare an email upfront and let mutt
just add From/To/Date/Message-Id etc as needed to the mail and be done with
it?

No, for that, IMO you're better off editing the headers by yourself via a script or something, and then invoking your MTA directly. Mutt just isn't set up to work that way.

--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA

Attachment: signature.asc
Description: PGP signature

Reply via email to