php mail() problem

braidiano

Verified User
Joined
Aug 22, 2007
Messages
7
Hi,

i have a problem with php mail() function.

It returns false and dosen't send any email. I cheked /var/log/exim/mainlog but there isn't anything. How i troubleshot the when is the issue?

if i try to send a mail through shell via "mail -s" command, it works properly.

thanks! :)
 
i found the problem:

2007-08-23 10:44:00 1IOAAS-0001ay-Lq Failed to create spool file /var/spool/exim/input//1IOAAS-0001ay-Lq-D: Permission denied
2007-08-23 10:44:00 1IOAAS-0001ay-Lq Failed to create spool file /var/spool/exim/input//1IOAAS-0001ay-Lq-D: Permission denied
2007-08-23 10:44:00 1IOAAS-0001ay-Lq Failed to create spool file /var/spool/exim/input//1IOAAS-0001ay-Lq-D: Permission denied
2007-08-23 10:44:03 1IOAAV-0001b1-UK Failed to create spool file /var/spool/exim/input//1IOAAV-0001b1-UK-D: Permission denied
2007-08-23 10:44:03 1IOAAV-0001b1-UK Failed to create spool file /var/spool/exim/input//1IOAAV-0001b1-UK-D: Permission denied
2007-08-23 10:44:03 1IOAAV-0001b1-UK Failed to create spool file /var/spool/exim/input//1IOAAV-0001b1-UK-D: Permission denied

how i fix this permissions?

thanks in advice!

Davide
 
thanks floyd, i ran /usr/local/directadmin/scripts/set_permissions.sh email but it doesn't resolve the problem, in the log file there is the same error..
 
Then you will have to do it manually. Example output of ls -ld /var/spool/exim/input

Code:
drwxr-x---  2 mail mail 1863680 Aug 23 09:34 /var/spool/exim/input
 
it is exactly the same of my /input dir:

drwxr-x--- 2 mail mail 4096 Aug 23 06:25 input/

any other ideas?
 
One thing that concerns me is the extra / between input and the message id.

/var/spool/exim/input//1IOAAV-0001b1-UK-D

I don't know why that is there.
 
thanks for your help floyd :)

there is any member of support staff that can explain me how can i fix this permissions or the wrong path that contains an extra slash?

thanks:)
 
One other thing that came to mind.. make sure that /usr/sbin/exim is chmod to 4755:
Code:
chmod 4755 /usr/sbin/exim
if it isn't, then apache calling exim will be running as apache, and won't be able to get root (then down to mail) which would cause permission problems.

John
 
i executed this:

chmod 4755 /usr/sbin/exim
chown -R mail:mail /var/spool/exim

and now it works fine.

thanks for your help! :D
 
Hello,

Try this command:
Code:
chown -R mail:mail /var/spool/exim
If that doesn't work, then try doing the full queue wipe at the bottom of this guide:
http://help.directadmin.com/item.php?id=112

Also, double // don't usually hurt anything.

John

Hi, i have one question about this... one of my clients have a web hosting, and he has a one form that send a email with the script mail in php but no receive this email and no have error in the program.. so my question is, WHY NO RECEIVE THIS EMAIL??????

Thank you.
Carlos,
 
All outbound messages have log entries in /var/log/exim/mainlog. You'd want to check that file to see what happened to your message.

John
 
All outbound messages have log entries in /var/log/exim/mainlog. You'd want to check that file to see what happened to your message.

John

I found this problem:
2008-02-20 09:47:17 1JRqE9-000AQJ-GK <= [email protected] U=root P=local S=420 T="Prueba" from
<[email protected]> for [email protected]
2008-02-20 09:47:17 1JRqE9-000AQJ-GK ** [email protected] F=<[email protected]> R=virtual_aliases:
2008-02-20 09:47:17 1JRqE9-000AQM-Jx <= <> R=1JRqE9-000AQJ-GK U=mail
P=local S=1301 T="Mail delivery failed: returning message to sender"
from <> for [email protected]
2008-02-20 09:47:17 1JRqE9-000AQJ-GK Completed

My Client have your server mail and host with me your web page.. in the same domain.
 
Back
Top