Julian Mehnle writes:

Hi Sam,

I'm running a courierfilter to filter incoming mail right at the SMTP dialog.  
Unfortunately, since I have been doing this, I cannot
use `sendmail` as an unprivileged user (!= root, != daemon) anymore:

  $ echo test | sendmail $my_address
  432 Mail filters temporarily unavailable.
  sendmail: Unable to submit message.

These are the permissions on the courierfilter socket directories and the socket of my courierfilter:

  $ cd /var/lib/courier/
  $ ls -lad allfilters filters
  drwxr-x---    2 daemon   daemon       4096 2003-12-05 23:00 allfilters
  drwxr-x---    2 daemon   daemon       4096 2003-12-05 23:00 filters
  $ sudo ls -la allfilters
  allfilters:
  srwxr-xr-x    1 daemon   daemon          0 2003-12-05 23:00 myfilter.pl

I think the socket(s) would need to be accessible (readable? writable? executable?) for unprivileged users (maybe for a dedicated

Correct. Here's what you missed:

# ls -l /usr/lib/courier/bin/sendmail
-r-s--x--x    1 root     daemon     140239 Nov 28 21:01 /usr/lib/courier/bin/sendmail

sendmail.c:

       setgid(MAILGID);
       setuid(getuid());

The end result is that the sendmail wrapper ends up running under whatever userid invoked it, but under the daemon group. Hence, those socket directories should be accessible to the sendmail wrapper.


Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to