Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sendmail and php
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
whitetr6
n00b
n00b


Joined: 11 Mar 2005
Posts: 28

PostPosted: Wed Jan 10, 2007 2:09 pm    Post subject: sendmail and php Reply with quote

My mail server and web server are in two different places. The public mail server (MX) record for my domain is on a box out of my immediate control. The web server though is running Gentoo and I can change anything I want. So I'm setting up a CMS to play with (MODx). Out of the box it comes with a contact form that apparently uses sendmail and the php mail() function to send the message from the form. So I emerged sendmail, and then set the following in php.ini:
Code:

sendmail_path = /usr/sbin/sendmail -t -i


and proceeded to test it with

Code:

sendmail -v me@myemailaddress.com < mymsg.msg


That returns
Code:

me@myemailaddress.com... Connecting to [127.0.0.1] via relay...
me@myemailaddress.com... Deferred: Connection refused by [127.0.0.1]


I think I understand that that means it will only send mail from the localhost itself. If I only want the server to send (not receive) mail, and PHP is on the same server, what would I need to do to allow the php mail() to work?

[Edit] Oh, and I'm running these commands from a remote ssh shell. Is that maybe the issue? Do I need to allow my firewall's public IP to relay in order for it to work from here?
Back to top
View user's profile Send private message
Dan
Veteran
Veteran


Joined: 25 Oct 2005
Posts: 1302

PostPosted: Wed Jan 10, 2007 2:50 pm    Post subject: Reply with quote

This has nothing to do with php or where you are connected to the shell from, It is your sendmail configuration. Did you setup sendmail after emerging it?
_________________
- Failure is not an option. It's bundled with your software.
Back to top
View user's profile Send private message
whitetr6
n00b
n00b


Joined: 11 Mar 2005
Posts: 28

PostPosted: Wed Jan 10, 2007 3:00 pm    Post subject: Reply with quote

Nope, I didn't. :oops:
I found a how-to in the forums now. Thanks for your suggestion. I see the smart host option in the file I need to edit, along with a couple other things. Thanks again
Back to top
View user's profile Send private message
mose
Guru
Guru


Joined: 04 Jun 2005
Posts: 313
Location: Piacenza

PostPosted: Wed Jan 10, 2007 3:17 pm    Post subject: Reply with quote

Why not using mail-mta/ssmtp ? If you simply want to send email using the php mail command, this is the easier method.
You configure ssmtp by putting in the conf file the details of the ssmtp server that you use with email address.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum