I have got a php web application needing to be able to send mail. My hosted Debian server came naked tool-wise, so I first installed sendmail as a MTA.
I first run in the issue that sending a mail was taking ages (that is, one minute for each mail). Googling the problem with my log details (in /var/log/mail.log), I found that my /etc/hosts file was not properly configured: the entry for 127.0.0.1 was set to my (not fully qualified) machine hostname, so sendmail was waiting 1 min till using some default working setting as hostname. I changed it to
127.0.0.1 localhost locahost.localdomain
and it worked.
I guess it would better be changed to some propel fully-qualified name – but I did not have time to dig much in the details at the moment.
Then I could send a mail from command line – but not from the web application, for some wrongly-set permissions reasons.
Searching again on the web, I got the feeling that postfix was a bit better than sendmail – so I just used it instead – and it worked straight away – so I reckon I’ll stick to that.
I now need to get more in details in the configuration (I had quite some spam issue in a previous project, which I’d rather avoid this time…)
