Welcome to WebmasterWorld Guest from

Forum Moderators: bakedjake

Message Too Old, No Replies

perl not available for sendmail programs

need help getting a .forward file to run a .pl file



4:20 pm on Aug 7, 2001 (gmt 0)

Inactive Member
Account Expired


I'm installing perl script on my server that requires a .forward file to point to a .pl file instead of just an email address. When I place this .forward file in the proper directory, and send a test email, I get the response:
sh: perl not available for sendmail programs
554 5.0.0 "/usr/bin/perl /home/virtual/talklist/home/httpd/cgi-bin/arplus/emailcapture.pl"... Service unavailable
I'm assuming this has something to do with smrsh according to sendmail.org's FAQ (Q3.34). However, before I edit anything blindly, I want to make sure I understand exactly what adjustments need to be made.

Does anyone have a sendmail background that give me the "step-by-step" on this?

6:11 pm on Aug 8, 2001 (gmt 0)

Full Member

10+ Year Member

joined:Feb 28, 2001
votes: 0

Hiya, welcome to Webmaster World! :)

It's been a while since I've done any real perl coding, but I would suggest that it's possible that your host has isolated some system commands. You might want to check with them. CGI-to-Sendmail gateways have often been used as a source for spam-mail enthusiasts prompting some hosts to kill the ability to use such systems.


6:19 pm on Aug 8, 2001 (gmt 0)

Inactive Member
Account Expired


Based on stuff I've read it appears I need to create a link to perl (/usr/bin/perl) in the directory where the sendmail.cf file refers to smrsh. The UNIX command would look something like:

%ln -s /usr/bin/perl

This supposed to allow a .forward file to run perl programs. Does this seem correct?

9:11 pm on Aug 8, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 25, 2000
votes: 0

If you're trying to set up autoresponseplus then good luck finding a host that allows cgi calls from a dot forward file. It seems it is a big security hole and most hosts won't allow it.


10:32 pm on Aug 8, 2001 (gmt 0)

Inactive Member
Account Expired


I'm using a dedicated server, so I have perhaps a little more control over the configuration. I also have the option of using a .procmailrc file. Would this be an easier solution than making the .forward file work?
10:12 pm on Aug 10, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 10, 2001
votes: 10

If you don't run that server yourself, then you'll have to check with the hoster's policies in any case, before you continue. This restriction is probably there for a reason. If in doubt, ask them first.

That being said, you can just wrap the call to the perl interpreter somehow, so that the sendmail process doesn't notice it.

Make sure you have the line "#!/usr/bin/perl" (without the quote) as the very first line of your script and give the file execute permissions so that the sendmail process can run it. Then you can have the .forward file just call the script directly, without mentioning perl. Of course, if sendmail is smart, then it will catch this trick and balk anyway.

Alternatively, create a file emailcapture.sh, with the following contents:
exec /usr/bin/perl /home/virtual/talklist/home/httpd/cgi-bin/arplus/emailcapture.pl
(unwrap the second line if necessary) give it execute permissions, and then just call this file from .forward.

The net effect of either method should be identical to what you tried at first, unless the current sendmail versions have really sophisticated security checks built in.

Note that you *are* potentially opening security holes by running perl scripts from .forward, so you better make sure your script is next to trivial and you understand *completely* what it does.