On Sat, Apr 07, 2012 at 10:02:31AM -0400, sean darcy wrote:
> On 04/07/2012 06:08 AM, /dev/rob0 wrote:
> >On Fri, Apr 06, 2012 at 03:23:02PM -0400, sean darcy wrote:
> >>Trying to route email to a script.
snip

> What's the advantage of forward over alias?

No root intervention nor configuration is required, and the script 
runs as that user.

> Perhaps related, postfix runs the script as user "nobody". This 
> means the script can do very little, unless I give "nobody" 
> wide-open sudo permissions (another BAD idea). I there a way to 
> specify the user (for instance, sendfax) the script runs under?

See above, and below. 

> >>cat /home/sendfax/fax/test-fax.cmd
> >>#!/bin/sh
> >>cat ->  output
> >>
> >>I've opened up all the permissions:
> >
> >Not really. You're using alias_maps which I presume[1] are owned 
> >by root, thus running the command as $default_privs user. You'd 
> >also be running this inside ~$default_privs home directory.
> >
> >Change "output" to "/tmp/output" and see what happens.

Did you look at the references?

> >References:
> >http://www.postfix.org/postconf.5.html#alias_maps
> >                        postconf.5.html#default_privs
> >http://www.postfix.org/aliases.5.html
> >http://www.postfix.org/local.8.html

One other option which was not already given is to add a 
sendfax-owned file to alias_maps. That option makes sense for 
something like Mailman, which needs to maintain multiple aliases and 
run commands as the mailman user. In this case it probably does not
make sense.
-- 
  http://rob0.nodns4.us/ -- system administration and consulting
  Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:

Reply via email to