homepage Welcome to WebmasterWorld Guest from 54.196.63.93
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
perl not available for sendmail programs
need help getting a .forward file to run a .pl file
whoisjb

10+ Year Member



 
Msg#: 34 posted 4:20 pm on Aug 7, 2001 (gmt 0)

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?

 

evinrude

10+ Year Member



 
Msg#: 34 posted 6:11 pm on Aug 8, 2001 (gmt 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.

whoisjb

10+ Year Member



 
Msg#: 34 posted 6:19 pm on Aug 8, 2001 (gmt 0)

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?

toolman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 34 posted 9:11 pm on Aug 8, 2001 (gmt 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.

whoisjb

10+ Year Member



 
Msg#: 34 posted 10:32 pm on Aug 8, 2001 (gmt 0)

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?

bird

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 34 posted 10:12 pm on Aug 10, 2001 (gmt 0)

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.

1)
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.

2)
Alternatively, create a file emailcapture.sh, with the following contents:
----
#!/bin/sh
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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved