procmail
[Top] [All Lists]

Re: smrsh, procmail, IFS, and lime jello

1995-12-04 17:09:52
 
 Phil Edwards asked:
 
                                 Smrsh needs a list of the valid
programs to which users may pipe their mail, and procmail is included
in that list.
        
        Your administrator should be aware that this is silly.  It defeats
the purpose of smrsh (sort of).  people can pipe to arbitrary programs
with procmail then.  What has your administrator won?
 
However, when we tested it, smrsh was unhappy about the && in the
.forward and didn't make it to the actual exec:

       "|IFS=' '&&exec /usr/local/bin/procmail -f-||exit 75 #somebody"

It seems that the Bourne shell syntax cannot be read by smrsh.  I've
done some experimenting with plain ol'
        
        smrsh is just a little wrapper for bourne shell.  It is not a real
shell by any stretch of the imagination.
 
       "|/usr/local/bin/procmail -f-#somebody"

and it seems to work, of course.  My question is:  what effect does
setting the internal field separator have on procmail?  My understanding
is that the change to the IFS will only last for the rest of the parsing
of the .forward itself, and will not affect the child processes (i.e.,
procmail).

        This is an incorrect understanding.  It will effect procmail itself.
Note that it was 

It is setting an environmental variable (that has already been exported)
and it is used by procmail.  So no, it effects procmail.  I am not sure
how seriously.
 
Will changing the format of the .forward to a minimalist version damage
anything?  Has anyone else implemented smrsh on their machine and solved
this already?

        How about something like:

"| /some/path/to/script # person"

script:

#!/bin/sh

export IFS
IFS=' ' &&
  /usr/local/bin/procmail -f- ||
  exit 75

Soren

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