The problem was that
mail() method worked when invoked with
php -r "mail('email@example.com', 'Subject', 'Message'); but when I tried it via the web server (apache in my case), in a php script, no email was sent and the
mail method returned
false. On top of this no error was displayed or logged anywhere not even
error_get_last function did not return anything and I had
error_reporting activated and full
After trying all the possible tests that I could imagine I tried to send an email by executing the
sendmail command form a php script. When I tried php’s
and checked apache’s error logs got the error
sh: /usr/sbin/sendmail: Permission denied. After I got this error it was obvious that the fix was to change the permissions for
/var/qmail/bin/sendmail so that apache can execute them.
Then said to myself:
Happy developing! and that was it.
This error was written in my maillog when I was trying to send an email with Thunderbird.
It seams that the reason for this error was the fact that I used on the outgoing server’s options a port number that was used for imap instead of the needed smtp server.
This error is really weird:
Mar 27 10:33:32 somehost postfix/smtpd: NOQUEUE: reject: RCPT from unknown[127.0.0.1]: 553 5.7.1 : Sender address rejected: not owned by user firstname.lastname@example.org; from= to= proto=ESMTP helo=
To fix this check out the outgoing server settings to have set the correct smtp port number.
The reason that the ssh commands were slow and sluggish (had to wait for seconds after enter was pressed to execute the command). There was nothing in the logs (that I could find) to help me identify this issue. I used google and many ideas from different forums without any luck.
I discovered that the changes I did to iptables some time before were wrong. Being a newbie I removed a rule that seamed suspicious (to me this rule looked too permissive):
ACCEPT all -- anywhere anywhere
To fix the issue I added the following rule back to my iptables. “This rule will allow all incoming packets destined for the localhost interface to be accepted.”
iptables -A INPUT -i lo -j ACCEPT