Re: Sendmail query
by neophyte (Curate) on May 31, 2001 at 17:18 UTC
|
A Super Search on Sendmail would have given you lots of relevant nodes. So here just a few hints:
The path to sendmail varies from nix-box to nix-box, your apache server (apache is just the webserving software, not an OS) might have it
in
my $mailprog = "/usr/lib/sendmail"; or
my $mailprog = "/usr/bin/sendmail";
or somewhere else entirely. Your friendly sysadmin will be able to tell you.
There is a sendmail for Win, but that is not necessarily installed on the box the IIS is running on. To be on the safe side you could use Net::SMTP, which runs on both platforms, but also is not guaranteed to be installed.
neophyte Niederrhein.pm | [reply] [d/l] |
Re: Sendmail query
by THRAK (Monk) on May 31, 2001 at 16:58 UTC
|
Maybe. If SendMail is in that location on that system and the code that uses it works. You may also want to look into Net::SMTP or Mail::Mailer. These should allow you to send mail from a WIN box if you have access to a SMTP server of some kind.
-THRAK
www.polarlava.com
| [reply] |
(boo) developing sendmail script on win32, production on *nix
by boo_radley (Parson) on May 31, 2001 at 17:24 UTC
|
It might.
Check with whomever administers that machine to verify the sendmail installation is probably the best starting point. That'll tell you if the path exists. Will your script work? who knows? :-)
Also, you may wish to investigate the $^O variable :
my $mailprog;
if (lc($^O) eq "mswin32")
#here is winland.
{$mailprog = 'C:\sendmail\sendmail.exe'}
# or whatever. I don't use sendmail on windows.
else
#here is *nixland
{$mailprog = "/usr/lib/sendmail"}
Update : Duh. Fixed error thanks to chromatic. | [reply] [d/l] |
Re: Sendmail query
by mpolo (Chaplain) on May 31, 2001 at 17:34 UTC
|
I'm not sure if you're writing from scratch or modifying one of those "bad" CGI scripts that are out there (or even one of those "good" scripts that use perl -T and cgi.pm). But a couple points couldn't hurt.
The command line flags you give to sendmail will be important for security. You will probably need to use -t and -i. The -t just tells sendmail to get the "To" and "Cc" information out of the headers of the mail you are sending. Unless you are root, you have to have a truthful "From", so that will be determined by the setup on the web server. The -i is very important. It tells sendmail that it should ignore any periods that are sitting on a line by themselves (this is the normal way to end an email in Unix) and wait until it receives the end of the input stream instead.
The reasoning here is that if you are in a CGI environment, an evil user might put a period alone on a line inside of a comment section, for instance, and then the remaining characters are being thrown at the OS (and being possibly executed, depending on how things are set up). The -i will avoid this dangerous situation.
According to the Module Reviews, the Mail::Sendmail module will work in both Windows and Unix, and may thus solve your dilemma. | [reply] |
|
Is sendmail a perl module or is it a part of unix os
| [reply] |
|
| [reply] |
Re: Sendmail query
by BigJoe (Curate) on May 31, 2001 at 19:16 UTC
|
I would use the Net::STMP module. This will allow your script to be run the same on an IIS server as it would on an Apache server. It is more cross platform friendly than hard coding programs into you scripts.
--BigJoe
Learn patience, you must. Young PerlMonk, craves Not these things. Use the source Luke. | [reply] |
Re: Sendmail query
by Beatnik (Parson) on May 31, 2001 at 21:52 UTC
|
| [reply] |