[imp] sudo sendmail problem

Jon Parise jon@horde.org
Wed, 19 Jun 2002 17:28:09 -0400


On Wed, Jun 19, 2002 at 02:52:31PM -0400, Data Vortex wrote:

> I am currently trying to configure imp to work in concert with my antispam
> local delivery agent (http://tmda.sf.net/).  This requires that the sendmail
> wrapper be executed as the user sending the mail.  I have written a sudo line
> to help solve this issue, but need help with the imp config.
> 
> In /horde/config/horde.php, I've set:
> 
> $conf['mailer']['type'] = 'sendmail';
> $conf['mailer']['params'] = 
> array('sendmail_path' => '/usr/bin/sudo -H -u $FIX$ /usr/bin/tmda-sendmail -t');
> 
> I need to interpolate the currently logged-in IMAP user there, how can I manage
> that?

Untested:

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


This is more correct, but I'm not sure if will alaways give you the
correct return value.  It also requires the Horde authentication
library to be included before the configuration file, which is not
easy to do.

array('sendmail_path' => '/usr/bin/sudo -H -u ' . Auth::getAuth() . ' /usr/bin/tmda-sendmail -t');

-- 
Jon Parise (jon@csh.rit.edu)  .  Information Technology (2001)
http://www.csh.rit.edu/~jon/  :  Computer Science House Member