Page 1 of 1

sendmail command problem

Posted: Wed Jul 18, 2007 2:33 pm
by bkozora
We've switched to a new server, so I'm setting up Swift again. I'm trying to use the sendmail option, but it fails, giving this error:
Error: Sendmail cannot be seen with lstat(). The command given [/usr/sbin/sendmail -bs] does not appear to be valid.
I've tried removing the -bs option, that gave another error stating it needed to have switches for the sendmail command. I've also checked on the server, and sendmail is exactly where it should be, /usr/sbin/sendmail. Any ideas?

Posted: Wed Jul 18, 2007 2:48 pm
by Chris Corbyn
It's a permissions issue on the server. To be honest I'm probably going to remove this check. I added it because I used to get loads of people telling me the sendmail connection doesn't work when in fact the problem was that sendmail didn't even exist ;) More annoying is the fact that if sendmail doesn't exist, PHP just hangs because it starts a BASH or DOS process instead...

You can edit the code in swift to remove that check and it will work if you're 100% it's there. Some servers (I still haven't worked out how to do it) have the permissions set so you can execute PHP, but you can't stat it. Very odd, but fixable.

Just remove this entire "if" block from lib/Swift/Connection/Sendmail.php in the start() method.

Code: Select all

if (!@lstat($this->getPath()))
    {

Posted: Thu Jul 19, 2007 6:05 am
by bkozora
Much thanks, that did the trick. Your fast reply truly sets you apart from some of the other developers for open source projects! I'll try to get my company to donate something for your efforts. Thanks so much

Posted: Thu Jul 19, 2007 2:31 pm
by Chris Corbyn
:) No problem, I'm a regular here ;)