Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Dec 01, 2010 5:50 pm 
Offline
Newbie

Joined: Wed Dec 01, 2010 5:46 pm
Posts: 3
I have msmtp set up and works. When I issue the command msmtp --serverinfo and also issue a command to send an email through the command line in msmtp there are no problems.

When I try to use php's mail() function, it doesn't work. I updated the php.ini file and sendmail_path to the msmtp location and it resorts back to the /usr/sbin/sendmail which is confusing. I restarted both apache and rebooted the server to no avail.

As I see it, there's a loose configuration option for php.ini's sendmail_path somewhere that still points to /usr/sbin/sendmail instead of /usr/bin/msmtp.

Does anyone have any thoughts or is there anything I can post that would help?

Travis


Top
   
 Post subject:
PostPosted: Wed Dec 01, 2010 7:45 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
If you're running mod_php check your apache configuration for a php_value option also run php --info | head -15 and check for these settings

Loaded Configuration File =>
additional .ini files parsed =>

They tell you what ini files you've loaded.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Wed Dec 01, 2010 8:44 pm 
Offline
Newbie

Joined: Wed Dec 01, 2010 5:46 pm
Posts: 3
@obs

Thanks for the recommendation. I found out that another php file was the primary one - /etc/php5/cli/php.ini (instead of /etc/php5/apache2/php.ini).

This fixed my command line problem of being able to send mail. But creating a php script that sends an email still fails. Is there a php config setting that disables scripts from using the mail() function?

Some googling didn't result in any satisfactory answers/leads. The debug simply says your server might not be configured to send mail using this method.

Thanks!
Travis


Top
   
 Post subject:
PostPosted: Wed Dec 01, 2010 11:09 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
only disable_functions would stop you sending mail, check your msmtp logs and see if php is actually talking to msmtp

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Thu Dec 02, 2010 1:14 am 
Offline
Newbie

Joined: Wed Dec 01, 2010 5:46 pm
Posts: 3
@obs

Thanks for the response. According to both logs there is no record of me having requested to send a message through a php script.

Here's what I have in mail.log:

mail() on [Command line code:1]: To: kiefertravis@gmail.com -- Headers:

Here's what I have in msmtp.log:

Dec 01 23:55:07 host=smtp.gmail.com tls=on auth=on user=cto@gumballcapital.org from=cto@gumballcapital.org recipients=kiefertravis@gmail.com mailsize=94 smtpstatus=250 smtpmsg='250 2.0.0 OK 1291247707 i21sm335658yha.44' exitcode=EX_OK

Both of these are from calling the php mail function from the command line. There is some kind of disconnect for the script and I don't know what it is or where to look for it.

Thoughts?

Travis


Top
   
 Post subject:
PostPosted: Sun Feb 06, 2011 8:56 pm 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
Did you get a solution to this?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group