procmail
[Top] [All Lists]

Re: Slight procmail problem

2004-03-16 10:21:13
At 11:17 2004-03-16 -0500, Gimme Zamore wrote:
I have procmail 3.22 install on a Solaris 9 machine. I am using netgroups to limit access to the machine by only allowing admins on the server while everyone else gets a shell that displays a generic message and disconnects them.

Even before reading the next phrase, I knew what you were about to say...

The problem I am having is that the global procmail receipe is being ignored for everyone except those that are allowed to login to the server.

no, you have something in it which relies upon invoking a shell process.

Near the top, define:

        SHELL=/bin/sh

(or whatever you want used for the shell).

This will define a shell to be used, even when the being-delivered-for user doesn't have a working shell (their shell program would be used, but since it just displays some message, it's not a functional shell).

Alternatley:

:0
* 9876543210^0 SHELL ?? ^^^^
* 9876543210^0 SHELL ?? ^^/some/hosed/shell^^
{
        SHELL=/bin/sh
}

Which would define shell only if it wasn't already defined to something presumeably working.

You could also preserve the shell to another variable, set it for the global procmailrc, then restore it on exit from the global (and erase the backup variable). The point being not to mess up whatever shell some admin might reasonably expect their own procmailrc to use:


# For users who can't log in, they don't have a valid shell!  Override with
# something sensible.
ORGSHELL=$SHELL
SHELL=/bin/sh

# (all your original /etc/procmailrc content)

# Do this, or else the SHELL will remain redefined even when users own
# personal .procmailrc is used.
SHELL=$ORGSHELL
# Be a good mushroom and undefine ORGSHELL.
ORGSHELL


---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>