Operating System - HP-UX
1828841 Members
2644 Online
109985 Solutions
New Discussion

calling script from .forward

 
andi_1
Frequent Advisor

calling script from .forward

Hi guys,

I'd like to execute a script whenever an email comes to an account:

here is my .forward file:

|/home/dev/perlScriptTest.pl

Here is my perlScriptTest.pl

#!/usr/bin/perl

open LOG, ">/home/dev/logfile" or die "Can't create logfile: $!";

print LOG "test";

For some reason, when I send email to the account, perl script is never executed?

If I execute script from the command line, "logfile" is successfully created.

Any ideas why>?

Thanks a lot!


1 REPLY 1
Graham Cameron_1
Honored Contributor

Re: calling script from .forward

Works fine for me.
Except I had to replace
#!/usr/bin/perl
with
#!/opt/perl5/bin/perl
in my script.

Have you checked the mail logfile ? This is usually /var/adm/syslog/mail.log, but if not there look in /etc/syslog.conf for the mail.debug entry.

Is the postmaster getting any bounced mail which originates from you ?
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.