msmtp from localhost and php mail
HI
I'm trying to set up a website on my machine to test an authenticated register/log-in script. The script needs to send a mail to the registrant. There are plenty of guides out there but not one I've been able to get working yet - once I've registered, the system fails to send a mail confirming the registrant's e-mail address. This is what I've done I have installed the msmtprc to /etc rather than ~ with permissions of 0644. This is msmtprc; Code:
# Accounts will inherit settings from this section /etc/httpd/php.ini I changed sendmail path to point to mstmp and mstmprc; Code:
sendmail_path = '/usr/bin/msmtp -C /etc/msmtprc -t' Code:
# /etc/rc.d/rc.httpd restart |
Logs?
Add this line to your .msmptrc defaults section (0600 perms would be better): Code:
logfile /path/to/msmtp.log Open a terminal and run: Code:
# tail -f /path/to/msmtp.log Open another terminal and run Code:
# tail -f /var/log/httpd/error_log Do what you do with your php form paying attention to the logs. PHP errors will appear at httpd error_log. I've never used msmtp with php, I ignore where could be the problem. |
Thanks for the reply, much appreciated.
I'm 99% sure that it's a permissions issue on /etc/msmtprc. Playing with various permissions I get either 'Permission denied' or 'must be owned by you' in httpd error.log. I'll try the msmtp man and see what I can find. |
Try first this:
Code:
# chgrp apache /etc/msmtprc I ignore if it's required on system config too. If it still complains try: Code:
# chown apache /etc/msmtprc it could be the permissions of the msmtp executable the cause. On Slackware sendmail uses the gid bit and a smmsp group: Code:
-r-xr-sr-x 1 root smmsp 800040 Apr 24 2010 /usr/sbin/sendmail Anyway the above are just workarounds to find the problem. More late you should investigate the "secure" solution. |
All times are GMT -5. The time now is 02:26 PM. |