LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   php script don't send email with qmail (https://www.linuxquestions.org/questions/linux-server-73/php-script-dont-send-email-with-qmail-590415/)

pk_kala 10-08-2007 10:57 PM

php script don't send email with qmail
 
This's php script

<?php
mail('root@localhost', 'the subject', 'the message', null,'-fwebmaster@localhost.com');
?>

This's qmail log
qmail-queue-handlers[28308]: Handlers Filter before-queue for qmail started ...
webpanel3 qmail-queue-handlers[28308]: cannot create temporary file - (13) Permission denied
webpanel3 qmail-queue-handlers[28308]: cannot read message from stdin


How i resolve?

Thank you

j-ray 10-09-2007 07:42 AM

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...
cheers, j

digitalboy74 10-09-2007 09:13 PM

It is likely that qmail is requiring /n/r in the php mail() headers

google phpsecurewiki mail()

pk_kala 10-11-2007 04:23 AM

Hi
This is qmail user:

alias:x:2021:2020:Qmail User:/var/qmail/alias:/sbin/nologin
qmaild:x:2020:2020:Qmail User:/var/qmail/:/sbin/nologin
qmaill:x:2022:2020:Qmail User:/var/qmail/:/sbin/nologin
qmailp:x:2023:2020:Qmail User:/var/qmail/:/sbin/nologin
qmailq:x:2520:2520:Qmail User:/var/qmail/:/sbin/nologin
qmailr:x:2521:2520:Qmail User:/var/qmail/:/sbin/nologin
qmails:x:2522:2520:Qmail User:/var/qmail/:/sbin/nologin

and qmail directory
/var/qmail

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?
Thank you

ghostdancer 10-11-2007 06:58 AM

It is possible that you use SMTP instead of the binary program for sending emails?

j-ray 10-11-2007 07:49 AM

chmod -R 0777 /var/qmail
(not very safe but will probably do the trick?)

ghostdancer 10-11-2007 08:32 AM

Quote:

Originally Posted by j-ray (Post 2920749)
chmod -R 0777 /var/qmail
(not very safe but will probably do the trick?)

No, no, no!

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.

pk_kala 10-15-2007 02:17 AM

Hi, ALL
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

adkeva 05-02-2009 08:33 AM

How to force users to change our password at the first connection
 
HI ALL,
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.

thanks


All times are GMT -5. The time now is 08:56 AM.