[imp] sudo sendmail problem

Data Vortex datavortex+sender+6bae77@datavortex.net
Fri, 28 Jun 2002 23:56:24 -0400


"Jon Parise" <jon@horde.org> invited blackmail by remarking:

> Untested:
> 
> array('sendmail_path' => '/usr/bin/sudo -H -u ' . $imp['user'] . '
> /usr/bin/tmda-sendmail -t');

Thanks very much for this tip.  I tried setting this in the config file
(horde/config/horde.php), but got errors indicating that $imp['user'] had
not been loaded yet.  Trying Auth::getAuth() prevented horde from starting
at all.

I did a little hacking, and I inserted the following line into function
prepareMailerParams(), within horde/imp/lib/IMP.php on line 1020 (after 
 $params = $conf['mailer']['params'];)  :

$params['sendmail_path'] = '/usr/bin/sudo -H -u ' . $imp['user'] . '
/usr/bin/tmda-sendmail -t';

Being rather newish at PHP, I also tried using an array() declaration
here, and also removing the $conf['mailer']['params'] line above entirely.
 Neither offered any luck.  The error I get when trying to send mail now
is:

There was an error sending your message: sendmail [/usr/bin/sudo -H -u
datavortex /usr/bin/tmda- sendmail -t] not executable

So, at least it is interpolating the username correctly....  I tried
changing httpd's shell from /bin/false to /bin/sh, but predictably, that
did nothing.

Any ideas?  Thanks for the continued help.

-- Larry