I had an issue where the permissions of /var/lib/php/session got overwritten so I could no longer created session variables in PHP.
I think the same thing is happening with my mail function. Where is the mail function located in a linux server so that I can chmod it?
Edit
Some additional information:
$ "This is a test" | mail -s "Testing 123" [email protected]
-bash: This is a test: command not found
Null message body; hope that's ok
postdrop: warning: mail_queue_enter: create file maildrop/111989.3781: Permission denied
postdrop: warning: mail_queue_enter: create file maildrop/112524.3781: Permission denied
postdrop: warning: mail_queue_enter: create file maildrop/113649.3781: Permission denied
postdrop: warning: mail_queue_enter: create file maildrop/114574.3781: Permission denied
postdrop: warning: mail_queue_enter: create file maildrop/115551.3781: Permission denied
chmod: changing permissions of `/usr/sbin/sendmail.postfix': Operation not permitted
chmod: changing permissions of `/usr/sbin/sendmail': Operation not permitted
The mail() function does many different things depending on how you configure it. You could be pointing it at an external SMTP server for example, if that is the case then there is nothing on your local system to touch.
If you haven't changed it from the default then you are running some mail transfer agent on your system, but there are a large number of possibilities. Are you actually running sendmail, or are you just running some tool which has a sendmail compatible binary? i believe Postfix is the default MTA on Centos. Unfortunately I am not sure what the spool folders are named and what the default permissions should be.
If nobody else answers with the specifics, then I suggest you quickly setup a virtual machine similar to your main system and simply compare and then repair the permissions.
From a command line shell you could also test things. Just run a command like
echo 'test' | sendmail [email protected]
.Check the sendmail_path variable set in your php.ini (by default: /usr/sbin/sendmail ) , which will be used by the php mail() function.
# /etc/postfix/post-install set-permissions