makemime not working like before?

Alessandro Vesely <[email protected]> Sun, 8 Feb 2026 17:29:22 +0100
Newsgroups gmane.mail.imap.courier.general
Message-ID <[email protected]>
Hi,

I have a Perl script which stopped working.  When I run it with an older 
version of makemime it works.  With a newer version, courier-1.5.0, it doesn't.

The script uses makemime like so:

	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) ."
			)
		)
		".'&0'."\n-\n" or warn("bad MM pipe: $!"), $failed = 6;

The script reads an email message with an attachment.  In the code above, <$fb> 
is a temporary file where the previous part of the script wrote an HTML 
description of the attachment.

The original message was saved as another temp file, <$fh>.  Before opening MM, 
the header from <$fh> was printed to stdout, except for MIME header fields 
which were saved to $mimestuff.  Now, the rest of the original message is being 
printed as a second entity, a multipart/mixed:

	if ($failed == 0)
	{
		print MM $mimestuff;
		print MM "\n";

		while (<$fh>)
		{
			print MM $_;
		}
	}
	close MM or warn "error closing MM pipe: $!";

No warning gets printed.  The HTML description is printed fine, but the 
attachment is lost.  The message produced terminates with an empty entity, like so:

--=_000035c3_0000000069888f36_00000001

--=_000035c3_0000000069888f36_00000001--

When run using the old makemime, the multipart, from header to closing 
boundary, was copied as a second entity.

Is there an easy fix to make the script work with the new makemime?


In case the above is unclear, the whole script is published here:
https://www.tana.it/sw/dmarc-xsl/


Best
Ale
-- 








_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users