procmail
[Top] [All Lists]

Re: formail -I

2002-04-07 12:11:02
"Ruud H.G. van Tol" <rvtol(_at_)isolution(_dot_)nl> writes:
...
Oops, that log is from the previous version of the recipe, in which I
emptied the SHELLMETAS just before the "formail -I".

The current log, with SHELLMETAS untouched, shows:
| procmail: safe_execprocmail: Failed to execute "/usr/local/sm.bin/sh"
| procmail: Program failure (69) of " formail -I "Subject:
[procmail]"$SUBJT"
| procmail: Rescue of unfiltered data succeeded

In his previous message, the recipe was given as:
:0 fh w
| formail -I "Subject: [procmail]"$SUBJT

Problem 1: SUBJT contains a space and is not quoted so the shell splits
it into multiple arguments.  You should move the variable expansion into
the double quotes.

        :0 fh w
        | formail -I "Subject: [procmail]$SUBJT"


My SHELL=/bin/sh, so where "/usr/local/sm.bin/sh" comes from, beats me.

Problem 2: See that mention of "safe_execprocmail" in the log?  That's a
reference to a patch that makes procmail only execute programs in
/usr/local/sm.bin.  Since there's no 'sh' program in that directory,
the entire exec fails.  The solution in this case is to get procmail to
do the exec of formail directly without using the shell.  Why is the shell
being used?  Because the command contains one or more characters found in
the SHELLMETAS variable: in this case, braces.  So you can either
a) unset SHELLMETAS for this command, or
b) hide the braces in a variable.

Since you can't invoke _any_ commands via the shell, you might as well
unset SHELLMETAS completely at the top of the rcfile and thereby disable
all use of the shell.


Philip Guenther
_______________________________________________
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>