I have a webserver running OpenBSD 4.7 and PHP 5.2.12 out of the ports tree. There is a small contact page that is supposed to send an email to a specific address. When I fill in the form using a web browser, it sends the AJAX request to the PHP page which claims it worked successfully but there is no email. The maillog is empty as well. I created a small php script that replicates this functionality and when I run it by hand using the "php -f" command, it sends an email without a problem. I think this has to do with being chrooted but I can't seem to get it to work. Furthermore, I can't seem to get PHP to log. I told it to log to /var/www/logs/php_errors.log and restarted but can't get it to send anything to the file. Does anyone have any tips for debugging these sort of things in OpenBSD?
So this is how I fixed it:
First, I had to compile a program called mini_sendmail and place it in /var/www/usr/sbin (php.ini was pointing to /usr/sbin/sendmail -t -i).
Second, I had to make sure that /bin/sh was copied into /var/www/bin/sh and /etc/resolv.conf was copied into /var/www/etc/resolv.conf. I still didn't get logging to work but I was able to finally get the web page to send emails.