procmail
[Top] [All Lists]

Re: forgive me if this is obvious

1999-09-07 10:07:20
Jacques has this recipe,

| :0 B c
| * ^For.*:.* ROBERT
| * !^X-Loop: Postmaster(_at_)calfp(_dot_)com
| | formail -A "X-Loop: Postmaster(_at_)calfp(_dot_)com" | $SENDMAIL -oi jackg

Because the [second] pipe in the action line is a character from $SHELLMETAS,
procmail needs to invoke a shell to do the secondary piping.  Unfortunately,
Jacques's shell is csh, and something in his .cshrc requires being connected
to a terminal, or maybe it requires a group permission granted him in
/etc/group that is not his login group, so his .procmailrc doesn't have it. 
Thus,

| When I do this, I get
| csh: Permission denied

yet

| If I change the last line to just:
| | $SENDMAIL -oi jackg

and procmail doesn't need to invoke a shell,

| I do not get the error.

or when he tries to do it from an interactive login session,

| I can run formail from the command line with no error ...

| Does anybody have any ideas?

Dallman did; set SHELL=/bin/sh at the top of your .procmailrc and then, when
procmail needs to invoke a shell, it will be a shell that doesn't run an
initialization file.  Alternatively, you could check through your .cshrc and
see what in there requires a connection to a terminal or a group permission
that your .procmailrc won't have, and you can put it into an if-endif
structure (not being a csh person, I don't know exactly how to do this) that
will run it only for interactive shells.  But all told, using sh as your
.procmailrc's shell will save you a lot of trouble, and it's easier to put
into place.

Then, thirty-nine lashes for using csh for a non-interactive shell.

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