[exim] exim and php's (mail)

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Klauss Fumuldavijus
Data:  
Para: exim-users
Asunto: [exim] exim and php's (mail)
Hello,
i've noticed capability of php(5.2.1) mail() function to terminate exim(4.66) without any SIGTERM in the exims logs or syslog - but it is not the major problem.

I simply got messed-up in permissions:

syslog shows:

May 21 16:51:06 myhost exim[50525]: exim: could not open panic log - aborting: see message(s) above
May 21 20:15:01 myhost exim[51048]: 2007-05-21 20:15:01 1HqBTJ-000DHL-B9 Couldn't chown message log /var/spool/mqueue/msglog/J/1HqBTJ-000DHL-B9: Operation not permitted
May 21 20:15:01 myhost exim[51048]: 2007-05-21 20:15:01 1HqBTJ-000DHL-B9 Cannot open main log file "/var/log/exim_mainlog": Permission denied: euid=80 egid=80

actualy - php's mail() calls exim as user www (80) and group www(80).
and exim stores mails as well as handles logging as user exim:mail (1003:6) - that causes "Permission denied"

the problem is that even after "chmod -R 777 /var/spool/mqueue" those errors appear again.
Why exim tries to chown message log? and how to avoid that?

the only solution i can work-out for a moment is invoking sudo in php.ini under sendmail_path variable:
sendmail_path = "/usr/local/bin/sudo -u exim /usr/local/exim/bin/exim -t"

maybe there are some less paintfull methods?

thank you for the suggestions