[exim] exim called in perl scripts

Top Page
Delete this message
Reply to this message
Author: p cooper
Date:  
To: exim-users
Subject: [exim] exim called in perl scripts
ive got exim as a dropin replacement for sendmail
Exim v 5.4
Gentoo linux 2.6.11-hardened-r15

I want to refer to sendmail in a a perl script Im doing.

ie
my $sendmail = "/usr/sbin/sendmail";
my $send_to = "blah"
my $subject = "Subject:";
my $to = "To: ".$send_to;
my $emailtext='blah';
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $subject;
print SENDMAIL $to;
print SENDMAIL "Content-type: text/plain\n\n";
print SENDMAIL $emailtext;
close(SENDMAIL);

I get  
grenada cgi-bin # perl testscript 
Exim is a Mail Transfer Agent. It is normally called by Mail User Agents,
not directly from a shell command line. Options and/or arguments control
what it does when called. For a list of options, see the Exim documentation.
grenada cgi-bin #                                                    


theres stuff inthe book and wiki about perl within exim but i cant find
anything about accessing exim from perl. I could use one of the ::Mail
modules from cpan but Id prefer (for portability reasons) to use sendmail.

with the
my $sendmail = "/usr/sbin/sendmail -t" i get in exim_panic.log

2006-01-01 14:14:25 1Et3yb-00054G-G3 User 0 set for local_delivery transport
is on the fixed_never_users list - I assume the mail is coming out of the
script with user root (the ID running the script)

ive got this as the first 2 routers

begin routers

system_aliases:
driver = redirect
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{/etc/mail/aliases}}
localuser:
driver = accept
check_local_user
transport = local_delivery

 in spite of  this in /etc/mail/alaises
# Well-known aliases -- these should be filled in!
 root:          paul
# operator:


Any clues to what ive missed ?


--
p cooper