Help! Sendmail on Mac OS X Server

T

Terry

Hi,

I am having trouble running a perl script on a Mac OS X (Panther)
server. This script ran okay on a Linux web server so I know the script
is okay. The script uses Sendmail to send an email message as
following.

open (M, "| /usr/sbin/sendmail -t");

print M "To: $address_01\n";
print M "From: $address_from\n";
...
# content of message

close (M);


I tested the OS X server with some simple perl scripts without using
Sendmail and they worked fine. So, I guess the perl interpretor was
working okay. I was thinking that maybe my script was having trouble
with Sendmail.

I did a "whereis sendmail" and it returned "/usr/sbin/sendmail". Does
this mean that sendmail is installed? If I used Postfix, how do I
change the perl script?

Can someone give me some troubleshooting/configuration tips on Sendmail
for Mac OS server (Panther)? I never worked on Mac server before.

Thanks in advance!

Terry
 
K

Keith Keller

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I am having trouble running a perl script on a Mac OS X (Panther)
server. This script ran okay on a Linux web server so I know the script
is okay. The script uses Sendmail to send an email message as
following.

open (M, "| /usr/sbin/sendmail -t");

The Perl answer: Use one of the various mail modules available from
CPAN. There's Net::SMTP, Mail::Mailer, Mail::Sendmail, plus possibly
others.
I did a "whereis sendmail" and it returned "/usr/sbin/sendmail". Does
this mean that sendmail is installed? If I used Postfix, how do I
change the perl script?

The OS X answers: Yes; if you followed the Postfix install instructions
then do whereis sendmail to find the new sendmail compatibility binary,
or read the Postfix docs to find out what to call. But I think you'll
find using one of the above modules easier and more consistent.
Can someone give me some troubleshooting/configuration tips on Sendmail
for Mac OS server (Panther)? I never worked on Mac server before.

You might want to post the above to comp.sys.mac.system instead; it's
not really on-topic for this group.

- --keith

- --
(e-mail address removed)-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBbEkvhVcNCxZ5ID8RAl7tAJ0YGiyTX0uJkAXOo4ijEBNFZvuO7QCbB9Z4
znFc545gYjI9R4Kf7Xqf4Jk=
=EckJ
-----END PGP SIGNATURE-----
 
M

Michael Vilain

Terry said:
Hi,

I am having trouble running a perl script on a Mac OS X (Panther)
server. This script ran okay on a Linux web server so I know the script
is okay. The script uses Sendmail to send an email message as
following.

open (M, "| /usr/sbin/sendmail -t");

print M "To: $address_01\n";
print M "From: $address_from\n";
...
# content of message

close (M);


I tested the OS X server with some simple perl scripts without using
Sendmail and they worked fine. So, I guess the perl interpretor was
working okay. I was thinking that maybe my script was having trouble
with Sendmail.

I did a "whereis sendmail" and it returned "/usr/sbin/sendmail". Does
this mean that sendmail is installed? If I used Postfix, how do I
change the perl script?

Can someone give me some troubleshooting/configuration tips on Sendmail
for Mac OS server (Panther)? I never worked on Mac server before.

Thanks in advance!

Terry

I have a contact.cgi script that does the following:

open (MAIL, "|/usr/sbin/sendmail $recipient") || die "Can't open
$mailprog!\n";

In subsequent lines, it writes a Subject:, Reply-To:, and Cc: line
before appending the body of the message. Works just fine on MacOS X
10.3.5.

Have you read the man page for sendmail on MacOS X? It's not the real
sendmail from 10.2.8. It's an interface into postfix.
 
A

A. Sinan Unur

I have a contact.cgi script that does the following:

open (MAIL, "|/usr/sbin/sendmail $recipient") || die "Can't open
$mailprog!\n";

There is no point in passing possibly dangerous data on to the shell.

You should take Keith's advice and use one of the Mail:: modules on CPAN.

Sinan.
 
M

Michael Vilain

A. Sinan Unur said:
There is no point in passing possibly dangerous data on to the shell.

You should take Keith's advice and use one of the Mail:: modules on CPAN.

Sinan.

Unfortunately, my hosting company won't change their perl or php
configuration for me, so I'm stuck using what works. I see the point in
this problem and will fix this approach but can't use CPAN modules
beyond what they have installed. I don't think anything short of my own
co-located server which would cost way more than $30/month would get me

Thanks for the suggestion though.
 
A

A. Sinan Unur

Unfortunately, my hosting company won't change their perl or php
configuration for me, so I'm stuck using what works.

Not true.

perldoc -q lib
I see the point in this problem and will fix this approach but
can't use CPAN modules beyond what they have installed.
I don't think anything short of my own co-located server
which would cost way more than $30/month would get me

See what you can get for that money.

http://www.linode.com/products/linodes.cfm

On the cheap side, try:

http://www.digitalspace.net/webhosting/

Sinan.
 
M

Michael Vilain

A. Sinan Unur said:
Not true.

perldoc -q lib


See what you can get for that money.

http://www.linode.com/products/linodes.cfm

This looks like a virtual domain service that offers email-only support
with a 6-hour guaranteed turnaround 'depending on the time of day'.
There's no mention of backups, data restores or live phone support.

These guys are cheaper, but they're in Lopoc, a 6-hour drive. I asked
and they also won't install additional CPAN modules on their system.

With my current ISP, I get a UNIX sysadmin with 20+ years experience on
the 2nd ring most times between 7am-12am weekdays and 8am-10pm weekends.
They do backups daily and maintain a climate controlled computer center
with network monitoring.

They're also located a mere a 30 minute drive across the bay if I need
to go over there. Colocation only really works effectively if you can
lay your hands on the system at any time, just as if it were in your
office's computer room. There are lots of little ISPs here in the SF
Bay area, some even only 1 hop away from the Mbone.

My current ISP has Net::SMTP installed. I'll see what I can do to make
that work instead of using sendmail directly.

Thanks for the advise and hosting options. I guess I didn't really look
outside the Bay area.
 
A

A. Sinan Unur

Please read below.

....
These guys are cheaper, but they're in Lopoc, a 6-hour drive. I asked
and they also won't install additional CPAN modules on their system.

Please read the FAQ that I mention above. :)
With my current ISP, I get a UNIX sysadmin with 20+ years experience on
the 2nd ring most times between 7am-12am weekdays and 8am-10pm weekends.
They do backups daily and maintain a climate controlled computer center
with network monitoring.

That is great. But the main point of my post was not to recommend you a new
ISP. Please read the answer to the FAQ I mentioned above.

Sinan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top