Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I have a line like this in my /etc/aliases:

foo-bar: "|/etc/smrsh/some_script"

some_script is being run as user mail, but I need it to be running as user nobody.

I'm using procmail as the local delivery agent, and the system is some bastardized RHEL.

How can I configure sendmail or procmail to do what I want?

share|improve this question

You can do this with sudo and another script. In /etc/sudoers, allow user mail to run commands as user nobody (and only user nobody) without a password, something like this:

mail  ALL = (nobody) NOPASSWD: /usr/bin/script2

then the contents of some_script will be a wrapper for script2:

sudo -u nobody /usr/bin/script2

script2 will then execute as user nobody.

Note I make no guarantees that there aren't huge security holes in this.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.