in reply to Sending mail: setting envelope id

I know you asked about a module, sorry, and I don't know if you can do this in your application, but, remember the standard old way of piping the entire mail through your mailer program?

In this way you can introduce header content at will.

$envid = 'Original-Envelope-ID: <whatever-envid-is>'; chop(my $date = `date "+%m/%d/%y-%H:%M%p GMT-5"`) my $mailer = qx!which sendmail!; if ( $? eq 0 ) { $recip = 'thereal@domain.com'; $fromaddr = 'realname <bla@bla.net>'; $subject = "thesubject"; $xmailer = "cgi"; $mailmessage = qq| A text message... |; } else { $mailer = "failed"; }


then,
sub dispatch { open(MAILPIPE,"|$mailer"); print MAILPIPE "To: $recip\n"; print MAILPIPE "From: $fromaddr\n"; print MAILPIPE "Subject: $subject\n"; print MAILPIPE "Date: $date\n"; print MAILPIPE "$envid\n" if $envid; #here print MAILPIPE "X-Mailer: $xmailer\n"; print MAILPIPE "$mailmessage\n"; close(MAILPIPE); } &dispatch unless $mailer eq "failed";