On Fri, 31 Aug 2012 10:54:00 +0900
Nathan Findley <[email protected]> wrote:
> From our more knowledgeable mimedefang users, I would appreciate an
> explanation about what is happening in the mimedefang.pl
> "resend_message_specifying_mode" method. The child execs sendmail.
> The message data is sitting in the child process's STDIN, correct?
Nope. The real magic happens here:
$pid = open(CHILD, "|-");
This forks a process and connects STDIN of the child process to the
CHILD descriptor in the parent.
> { exec($sm, @cmd); } <-- how is sendmail receiving the contents of
> the message? I don't see any explicit piping happening.
Whatever the parent process writes to the CHILD descriptor shows up on
STDIN of the child. As in:
if ($pid) { # In the parent -- pipe mail message to the child
print CHILD $body;
close(CHILD);
return;
}
And you can stream messages in filter_end if you like.
Regards,
David.
_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID. You may ignore it.
Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang