[PLUG] Sendmail w/ PERL

Matt wirges@expert.cc.purdue.edu
Mon, 02 Oct 2000 07:30:13 -0500


Okay so I have a formmail script that creates a message like this:

open (MAIL,"|/usr/lib/sendmail -t") || die "Could not open sendmail,
$!";
print MAIL "To: $email\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subj\n\n";
print MAIL "$body\n";
close (MAIL) || die "Could not close sendmail, $!";

That works fine, I will get an email that says:
>	To: someone@somewhere.com
>	From: sender@somewhere.com
>	Subject: Test Mail
>
>		This is a test this is only a test.
> 
however when I use that same code in a mail program from the command
line
sendmail doesn't seem to be able to extract the <B>From:</B> and the
<B>Subject:</B> lines from it.
I get an email that looks like this:
>	To: someone@somewhere.com
>	From: root@archimedes.swi.dyndns.org    (sendmail missed the from: field and supplied the default)
>	
>	Subject: This is a test 		(This is the message body, the string "Subject: This is a 
>	This is a test this is only a test.     (test." Was put in the body and not the header.);
>
I of course checked to make sure the vars got passed correctly to
sendmail and they did, Any one got any ideas?
-- 
==============================================================================
| Matthew Wirges							     |
| Systems Administrator, Student, Programmer, Geek.			     |
| Office Phone: [765]464-1148     					     |
| Email: wirges@expert.cc.purdue.edu ||
sysadmin@sharpwebinnovations.com     |
| www.sharpwebinnovations.com						     |
==============================================================================