php script don't send email with qmail
This's php script
mail('root@localhost', 'the subject', 'the message', null,'-email@example.com');
This's qmail log
qmail-queue-handlers: Handlers Filter before-queue for qmail started ...
webpanel3 qmail-queue-handlers: cannot create temporary file - (13) Permission denied
webpanel3 qmail-queue-handlers: cannot read message from stdin
How i resolve?
i assume the script is run via a http server and not from command line. The server user ( apache -> nobody or www ) doesnt have the rights to create the needed temporary file. So set the directory where it should be created to
chmod 0777 directory
i dont know where qmail uses to create that unfortunately. You have to find out yourself...
It is likely that qmail is requiring /n/r in the php mail() headers
google phpsecurewiki mail()
This is qmail user:
and qmail directory
drwxr-sr-x 2 alias qmail 4096 Jul 6 16:08 alias
drwxr-xr-x 2 root qmail 4096 Jul 12 19:34 bin
drwxr-xr-x 2 root qmail 4096 Jul 12 19:34 boot
drwxr-xr-x 2 root qmail 4096 Oct 11 16:12 control
drwxr-xr-x 7 qmaild qmail 4096 Jul 11 21:19 handlers
drwxr-xr-x 16 root qmail 4096 Oct 10 17:30 mailnames
drwxr-xr-x 2 root qmail 4096 Jul 12 19:34 plugins
drwxr-x--- 11 qmailq qmail 4096 Jul 6 16:08 queue
drwxr-xr-x 2 root qmail 4096 Oct 10 17:30 users
How i resolve this problem?
It is possible that you use SMTP instead of the binary program for sending emails?
chmod -R 0777 /var/qmail
(not very safe but will probably do the trick?)
qmail is structure such that, instead of a single task to handle emails, it is split into many small task. One handle injecting, one handle local email, one handle remote email and so on. So, User permission is very important, since each task will run in its own user level. Creating an incorrect ownership file may lead to even more problem.
I run chmod -R 0777 /var/qmail already.( before
ghostdancer post reply )
Now I think my qmail is broken.
I reinstall already.
Thank you very much
How to force users to change our password at the first connection
i use a server qmail+Vpopmail+qmailadmin+squiremail
and when i create a user account the default password is "password".
can someone help me to find a script to force user to change password at the first connection and one once per month.
|All times are GMT -5. The time now is 10:59 AM.|