Some kind of MAMP/sendmail/PHP issue
I'm trying to test a website that I am developing using MAMP, PHP 5.3, and sendmail on Mac OS X 10.5.8. My php script is using $_SERVER['PHP_SELF'] to collect form data via POST. When I submit test input, the page reloads as expected, but it doesn't send the form to my email as expected.
I haven't done anything to the default httpd.conf that came with MAMP, and I've only uncommented line 566 (the UNIX sendmail config line) in php.ini. I manually launched sendmail via console, and it seems to have started without issue.
If I've gotten everything configured correctly in MAMP, and my sendmail is working correctly, and there's not a bug in my php script, I should be able to send my form data to email right? I'm not extremely proficient with php, but I'm pretty sure the script I've written should be good to go. Is there anyone with more experience with this than me who can help me get this sorted out?
Drew Richards
(1,558 posts)And if it is doing a call...permissions on script default probably on 655 needs to be 755
Make SURE to run sendmail as a protected user account NOT as root or you have left big security hole due to php script attacks....
I would recommend you rethink your design...sendmail while easy to setup and run has a lot of insecurities....reconsider same design but use postfix.
You were spot on regarding the permissions on the script. I had to re-set them to 755.
I'm using Aptana to develop the script, and it's got a built-in PHP debugger. The good news is that it doesn't show any errors, so I think I'm ok on the script side of things.
I'm trying to move to postfix from sendmail. I think all I need to do in php.ini to make the move is change the path from /usr/sbin/sendmail to /usr/postfix right? And from there, I need to configure postfix to allow me to send mail from localhost. Not quite sure how to do that just yet, but I'm sure there is documentation that I just haven't found yet.
Drew Richards
(1,558 posts)Before you make final install go read about CHROOT and see if its something you want to do...
In a nut shell...building mail using chroot basiclly segments mail and their directories to a secure permission locked directory structure...securing the rest of you server and applications away from many of the piss ant script kiddies exploits...its a bit more work but can save you from having to reformat and restore from a nasty root hack.
Drew.