Linode Forum
https://forum.linode.com/

MSMTP Configuration - Can't send through php mail()
https://forum.linode.com/viewtopic.php?f=11&t=6348
Page 1 of 1

Author:  kieftrav [ Wed Dec 01, 2010 5:50 pm ]
Post subject:  MSMTP Configuration - Can't send through php mail()

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

Author:  obs [ Wed Dec 01, 2010 7:45 pm ]
Post subject: 

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.

Author:  kieftrav [ Wed Dec 01, 2010 8:44 pm ]
Post subject: 

@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

Author:  obs [ Wed Dec 01, 2010 11:09 pm ]
Post subject: 

only disable_functions would stop you sending mail, check your msmtp logs and see if php is actually talking to msmtp

Author:  kieftrav [ Thu Dec 02, 2010 1:14 am ]
Post subject:  No record in msmtp.log or mail.log

@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

Author:  tentimes [ Sun Feb 06, 2011 8:56 pm ]
Post subject: 

Did you get a solution to this?

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/