Re: sending mutlipart/mixed draft file

"Kevin J. McCarthy" <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <aZvx_RxIhxuvf5cw@qinghai>
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
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmmb8f0ACgkQre92hIAx
a9paVw//fVf19wN+xr1cl5uYnZjLFCnZOgEKxMEk9Ym5jDyCHAAZEYWv1ip13N0e
Xt8ojXVDdsISNVNcxZ7ucqtnJhoMr0u1/mVabZcFAQ1f8VJt52pZyveaPJkPJUKl
rNhUGZYZejlAQdF+HUGHuLFCF7AjBPJNjZJbHmoz31vgQMB8F3OlhTuslrRs/43I
o2c5TzzLEh23uuqlYMy6RI3q13NykjqnJv9JXIDt9STRIEy1gea87sHol43kQaaH
Z++jXe4HlYaVF8V3KhPvUHvkO+jt8vRzvVoHogyLyhpEmz89o+iEPVC37otvxloj
MCoCK7CljJ5OXaxC8xLBQ12hpHTgFdZwxV9lPIONLUOCHm2g9WH0Z1NHEiRsWjaq
YK9xEN9l98Lq8+13k5j8qN8qPnqqEG7ATEr3h1zcmLsJawwO/enWvykrUOvz0foR
3tm3qzDnfkHvQ+krWqy1hy0TdhZ0fQpFLhTYw2teoZpjtt7Gjp02bIj79MSL1O/2
Pianv7WxL3y7GU5N9R56PUPYLGRBm/OFx2IwW9DvVnHOgNASPmmSh+NlbZEa8Phq
sptVvjWPqrCZQWFEG4L40UHJy5xQuzrXncnSdtxXAPWHExm4LHT+ac5sIQq3k652
ntjDvQGutol2jZ8+J4oHCSe9tfry+hoYN//rBn3JxX/rivODmH4=
=gv9u
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.