I am running a centos 5.2 server with postfix and php 5 installed. I am having problems with php mail(). Mails are sent but it takes about a minute for the page with the mail() function in it to load. The mails are very short and text only. I had the same script on a different server before (shared hosting) were things just worked perfectly and very fast. I suspect that there is a problem with my server settings. Any ideas???
Can you post an excerpt where you try to send a mail with the PHP mail() function? I don't see anything like that in the excerpt you posted.
I have send several mails with the php mail function that day. If there isnt anything in the mail error log that means it didnt throw an error. I mean the mail also got send. Just the script sending the mail is taking a minute or so to send out the mail.
This is so strange. When i send out one mail message and i didnt send one in a while the script is running forever. But once i send this first mail message, the messages i send out right afterwards are sent in no time. Could it be that my mailing server has to be awakened from his winter sleep first before it starts sending mails. After i stop sending mails it seems to go back to sleep again within a few minutes. This is really not very satisfying. Is there anything i can do about that? what is causing this?
You could try to install a PHP opcode cacher like eAccelerator, Xcache, or APC and see if the behaviour changes.
I thought I just let you know that I solved the issue. It was the sendmail path in php ini that caused the script to go incredibly slow. i changed it to: sendmail_path = /usr/lib/sendmail.postfix -t -i No the mails fire real fast. However I am having another problem now. In my maillog file I frequently see messages like this: Feb 1 19:44:29 server1 postfix/smtp[4591]: 88B9F14A81EE: to=<[email protected]>, relay=none, delay=20, delays=0.02/0.01/20/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again) Same thing happens with yahoo or hotmail. It doesnt happen with every mail but quite often. Any ideas on this one?
My resolv.conf looks like this: Code: # generated by NetworkManager, do not edit! ; Use a local caching nameserver controlled by NetworkManager nameserver 127.0.0.1 I tried adding nameserver IPofMyServer.here nameserver IPofMYWebSite.here but the changes were lost when I rebooted the server. How can I make changes to this file without having to redo them each time the server reboots. Would the abouve be sufficient or is there anything else i should add?
I added nameserver domainIP nameserver serverIP already. I didn't see the error message come up oin maillog anymore but I keep monitoring for a while. Still I guess if I reboot the server those changes will be lost again. Is there a way to make those changes permanent?