image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old July 10th, 2002, 03:40 AM
Registered User
 
Join Date: Aug 2001
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
liquidg3 is on a distinguished road
HOW TO: Sendmail and PHP

now this is my first how to so please bare with me:

first off...

any mail sent from the mail() function in PHP is sent from a user called "www"
now the trick is getting you@yourdomain to accept emails from www, emails from you@yourdomain.com to www work fine, but we don't care about it working like that since www is sending emails to us. Don't ask me why this is so hard, but i guess it is =) (There may be a better way, but this is very simple once you have sendmail set up.

I just got this working 10 minutes ago and on X server, so if something doen't work, just reply... ok, here we go.

First we have to create a user that sendmail can use AND likes:

STEP 1: Create a new user, whether with "Server Admin" or "System Prefrences" (Have not tried the second)

STEP 2: Make sure he/she has a home directory ie. users/tom


Next we set up our server... (This is assuming you have MX records set, if you don't, QuickDNS is a great option, or just buy a bind book)

STEP 1: Set up sendmail here, these directions can be confusing, but don't worry, we'll double check everything later.

STEP 2: Install Webmin, HOW TO courtesy yoshi . If you do not want to d/l Webmin, skip to step 4.

STEP 3: Go to yourdomain.com:10000 or however you have it set and click on servers, then scroll down to 'Send Mail Configuration'

STEP 4: Check to make sure everything is entered correctly:

Mail Aliases = I have none

Local Domains = yourdomain.com
mail.youdomain.com
localhost

Address Mapping (virtuser) = Click manual edit and enter the following

you@yourdomain.com you
www@yourdomain.com www


Outgoing Addressed (genericstable) = Click manual edit and enter
you you@yourdomain.com
www www@yourdomain.com
(same as address mapping, just reversed)

One last thing, not sure if this is required:

Spam Control (access) = click on manual edit and enter
10.0.0 RELAY <--- you reall ip minus last set of numbers
localhost RELAY

---------------------------------------------------------------------------------------------

That should do it, you may want to turn restart sendmail, turn it off then on through Webmin. . . but that should be it, any questions please post, i could very easily have missed a step. (On X server, I have mail service off, all email is now begin run through sedmail)

Enjoy

Last edited by liquidg3; July 10th, 2002 at 12:29 PM.
Reply With Quote
  #2  
Old July 12th, 2002, 08:36 PM
Registered User
 
Join Date: May 2002
Location: The Netherlands
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
FireFly-NL is on a distinguished road
why all the trouble with webmin?

just install php using:
http://www.entropy.ch/software/macosx/php/

then enable sendmail using:
http://www.kung-foo.tv/xtips.php#15
Reply With Quote
  #3  
Old July 12th, 2002, 08:42 PM
Registered User
 
Join Date: Aug 2001
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
liquidg3 is on a distinguished road
Webmin

That works as well, but with webmin it is very easy to edit any settings remotely form any OS... i was at school today with Gateways, and i needed to do some re-adjusting in apache... through web admin i was able to change apache settings as well as sendmail settings through the browser, but of course its not necessary.
Reply With Quote
  #4  
Old July 18th, 2002, 03:57 AM
Registered User
 
Join Date: Apr 2001
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
ppmax is on a distinguished road
i may have misunderstood what you were trying to do, but i set up a test php page that seems to mail fine without some of the customizations you mention below.

here's a snip:

<?PHP

mail("xx@xxx.net", "Test Subject", "Test Body", "From: username@$SERVER_NAME", "-fwebmaster@$SERVER_NAME");

echo "mail sent from ";
echo $SERVER_NAME;
?>

xx@xxx.net = the address you want to send to
username = your username

does this work for you?
Reply With Quote
  #5  
Old July 18th, 2002, 04:57 PM
Registered User
 
Join Date: Aug 2001
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
liquidg3 is on a distinguished road
i tried that and i couldn't get it to work... so i was forced to go the other way.,
Reply With Quote
  #6  
Old July 19th, 2002, 01:14 PM
Registered User
 
Join Date: Apr 2001
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
ppmax is on a distinguished road
can you tell me a bit about your setup?

do you have a static IP?
is your hostname set correctly in your hostconfig file?
did you add your hostname to the hosts file?

im not saying that anything is "wrong" on your system--but you shouldnt have to tell sendmail what domain it's sending from. sendmail should be able to figure this out by itself.

ppmax
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail on localhost w/ php .jeremy_a> Unix & X11 1 November 8th, 2003 10:27 AM
PHP and Crontab Zimbop Design & Media 11 December 5th, 2002 10:31 AM
mail() in PHP iFunk Mac OS X System & Mac Software 0 November 17th, 2001 08:45 PM
10.1 and PHP mail() function WhateverJoe Mac OS X System & Mac Software 1 October 18th, 2001 12:08 PM
Setting up Sendmail & PHP Fahrvergnuugen Mac OS X System & Mac Software 1 July 10th, 2001 03:39 AM


All times are GMT -5. The time now is 03:42 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.