Re: [exim] exim called in perl scripts

Pàgina inicial
Delete this message
Reply to this message
Autor: p cooper
Data:  
A: exim-users
Assumpte: Re: [exim] exim called in perl scripts
sorry to be so slow - Im an 'interested amateur' in this

when I add perl module
use Mail::Sendmail;
I can send mail from the script ( either as root and chowned root:root or
chowned me:user and su'd me) and its handled by exim . Dont usderstand why
though

2006-01-02 14:51:55 1EtR2R-0005Zk-Gf <= webserver@myserver .org.uk H=(grenada)
[127.0.0.1] P=smtp S=6976
2006-01-02 14:51:56 1EtR2R-0005Zk-Gf => me@??? R=send_to_gateway
T=remote_smtp H=smtp.isp.co.uk [xx.xx.xx.xx]
2006-01-02 14:51:56 1EtR2R-0005Zk-Gf Completed

using the exim/sendmail pipe ( run as user ;-) )
my $sendmail = "/usr/sbin/exim -bm -t -i";
user =me
but the sendmail lines need a "\n" at the end of each line

ie
{
open(SENDMAIL, "|$sendmail") or die "Cannot open mailer: $!";
print SENDMAIL "$subject\n";
print SENDMAIL "To :me\@isp\n";
#print SENDMAIL "Content-type: text/plain\n\n";
print SENDMAIL $text;
close(SENDMAIL);
}

and it works . Not sure why I seem to be different to other setups ive googled
( probably a perl setup question)

thanks for the help .