Setting up sendmail

I do pro bono web sites for charities. I have always tested new scripts on the target site. I just recently realized that Apache is installed on my Mac.

After a few hours of Googling I've manged to set up the Apache config file

"/private/etc/httpd/users/<user_acct>.conf"

enabling cgi, php, ... and run my local site from

"/Users/<user_acct>/Sites"

Now the question. After number of hours I've been unable to find any reliable information on setting up sendmail. All references would re appreciated.

G4 Tower Mac OS X (10.4.10)

Posted on Jul 2, 2007 8:39 AM

Reply
7 replies

Jul 2, 2007 12:24 PM in response to Bill Scott

Bill, In the info you gave me I see this

"Apple OS X since 10.3 comes with postfix, a more secure drop-in replacement for sendmail."

Since I use sendmail on the servers I run websites at, I really need sendmail.

I don't really want a full blown mail server; just a server to take sendmail commands from perl scripts and send out emails. My website scripts typically take POST information, filter it to make sure it is from a valid source, parse and reformat it, append it to a log file and then send the reformatted information to the appropriate person(s) via sendmail.

Thanks,
bob j

Jul 2, 2007 2:08 PM in response to RobertJ

Since OSX now uses postfix, for testing:

1 - Can I change the path in the perl files from "/usr/lib/sendmail" to "path to postfix"?

2 - Use the standard Perl commands

print MAIL "To: $TO\n";
print MAIL "From: $FROM\n";
print MAIL "Subject: $SUBJECT\n";
print MAIL "Content-type: text/plain\n\n";
..........

with the pipe opened to postfix rather than sendmail on localhost?

3 - Using Postfix Enabler configure postfix for outbound SMTP only through my ISP to accept the "print" info from my Perl script to verify the correctness of the parsed outbound email(s)?

Jul 2, 2007 4:20 PM in response to RobertJ

Since OSX now uses postfix, for testing:

1 - Can I change the path in the perl files from
"/usr/lib/sendmail" to "path to postfix"?


You don't need to do that. There's actually a sendmail command there that's kind of a drop-in replacement. It's at /usr/sbin/sendmail, so there's an issue of paths you'd need to deal with in your scripts.

2 - Use the standard Perl commands

print MAIL "To: $TO\n";
print MAIL "From: $FROM\n";
print MAIL "Subject: $SUBJECT\n";
print MAIL "Content-type: text/plain\n\n";
..........

with the pipe opened to postfix rather than sendmail
on localhost?


This works for me:

<pre class="command">open (MAIL, "| /usr/sbin/sendmail -t") || print "Nothing happened.";</pre>

(obviously followed by all the print to MAIL commands).

charlie

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Setting up sendmail

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.