Sendmail calling a script on inbound mail

From: Andy Ford (Andy.Ford@telindus.co.uk)
Date: Mon Mar 06 2006 - 11:45:20 EST


First of all I will apologise to those who believe this mail is misplaced in a
Sun admin group - but it may be related.
I am trying to get sendmail to call a Perl script. To do this I have ...

1. modified /etc/aliases with: testUser: "|/usr/local/bin/mailHandler"
2. run newaliases
3. run /usr/lib/sendmail -bv testUser which returns...
"|/usr/local/bin/mailHandler"... deliverable: mailer prog, user
|/usr/local/bin/mailHandler
4. sent a mail using the Perl module Mail::Sendmail from the host to itself.

------------ Mail::Sendmail script -----------------
#!/usr/bin/perl -w

sendMail();

sub sendMail {
        use Mail::Sendmail;
        my $mail;
        $mail{To} = 'testUser@telindus.co.uk';
        $mail{From} = 'root@telindus.co.uk';
        $mail{Smtp} = '<10.24.2.1>';
        $mail{Subject} = "TEST";
        $mail{Message} = "TEST";
        sendmail %mail;
}
-----------------------------------------------------

My questions are...
 - Will it cause an issue if the box isn't part of a domain?
 - How the hell do I get it to work?

I assume I would send the mail to testUser@localhost. As I'm not using a
domain, is that correct?
I have queried google but not found any useful docs on how to achieve it and
what to do with the numerous error messages sent to the root account like ...

The original message was received at Mon, 6 Mar 2006 16:38:57 GMT
from mymailserver [10.24.2.1]

   ----- The following addresses had permanent fatal errors -----
<testUser@telindus.co.uk>

   ----- Transcript of session follows -----
550 5.1.2 <testUser@telindus.co.uk>... Host unknown (Name server:
telindus.co.uk: host not found)

Any help would be much appreciated

Thanks

Andy

Visit Telindus Access Products & Surveillance Solutions at Cebit 2006, Hall
13, Booth 34, 9-15 March 2006.
Discover Telindus' range of access & surveillance products in a live "voice
and video over DSL" demo and collect the new catalogue 2006-2007. See you in
Hannover!

This e-mail is private and may be confidential and is for the intended
recipient only. If misdirected, please notify us by telephone and confirm
that it has been deleted from your system and any copies destroyed. If you
are not the intended recipient you are strictly prohibited from using,
printing, copying, distributing or disseminating this e-mail or any
information contained in it. We use reasonable endeavours to virus scan all
e-mails leaving the Company but no warranty is given that this e-mail and any
attachments are virus free. You should undertake your own virus checking.
The right to monitor e-mail communications through our network is reserved by
us.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:39:12 EDT