Re: makemime not working like before?
Sam Varshavchik <[email protected]> Sun, 08 Feb 2026 14:01:46 -0500
| Newsgroups | gmane.mail.imap.courier.general |
|---|---|
| Message-ID | <[email protected]> |
This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.
--===============8247640447977017101==
Content-Type: multipart/signed;
boundary="=_ripper.email-scan.com-672605-1770577306-0001";
micalg=pgp-sha1; protocol="application/pgp-signature"
Content-Transfer-Encoding: 8bit
This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.
--=_ripper.email-scan.com-672605-1770577306-0001
Content-Type: text/plain; format=flowed; delsp=yes; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Alessandro Vesely writes:
> Hm... I tried the following instead of the code above, but it prints the
> help text.
>
> open(MM, '|-', 'makemime @-') or warn("can't fork: $!"), $failed = 5;
> print MM "-j
> (
> -m
> multipart/mixed
> -a
> MIME-Version: 1.0
> (
> -c
> text/html; charset=utf-8
> ". '&'. fileno($fb) ."
> )
> )
> (
> -c
> message/rfc822
> -a
> Content-Disposition: inline
> ". '&0' ."
> )
> " or warn("bad MM pipe: $!"), $failed = 6;
>
> What am I missing?
The following seems to work:
[mrsam@jack rfc2045]$ cat args
-j
(
-m
multipart/mixed
-a
MIME-Version: 1.0
(
-c
text/html; charset=utf-8
htmlintro.txt
)
)
(
-c
message/rfc822
-a
Content-Disposition: inline
forwardedmsg.msg
)
[mrsam@jack rfc2045]$ cat htmlintro.txt
<h1>Title</h1>
[mrsam@jack rfc2045]$ cat forwardedmsg.msg
Subject: a forwarded message
text
[mrsam@jack rfc2045]$ ./makemime @- <args
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=_000b4e68_000000006988dbca_00000001"
Content-Transfer-Encoding: 8bit
[ the rest of the message appears well formed ]
It's pretty clear that it's the attempt to repurpose the same file
descriptor that's at issue here. That's going to be plan B. Looking at the
entire version of the old makemime C code I think I see how this broke when
this was reimplemented in C++. It broke specifically because it's a pipe,
this would still work if stdin is a plain file, however I think this patch
will fix this:
diff --git a/rfc2045/makemime.C b/rfc2045/makemime.C
index 84e23459..4c235d64 100644
--- a/rfc2045/makemime.C
+++ b/rfc2045/makemime.C
@@ -180,7 +180,7 @@ static rfc822::fdstreambuf openfile(std::string_view filename)
exit(1);
}
- fp=std::move(tfile);
+ dup2(tfile.fileno(), fd);
}
else
{
--=_ripper.email-scan.com-672605-1770577306-0001
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
iHUEABYKAB0WIQRupkKLJP96aW75pIOKYPgoojZS4gUCaYjdmgAKCRCKYPgoojZS
4r9tAP0Ucm1nfO8uet35ao5eimtcqdXcMnl+joMq0qbtyiyvewEAxcGw/IwmlXIV
SfXzO8kXvEC3ZDd2mEvWrw/rSk75zw4=
=uSsU
-----END PGP SIGNATURE-----
--=_ripper.email-scan.com-672605-1770577306-0001--
--===============8247640447977017101==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============8247640447977017101==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
--===============8247640447977017101==--