procmail
[Top] [All Lists]

Re: handing strange characters in Subject

1998-01-16 12:54:51
Timothy J Luoma <luomat+procmail(_at_)luomat(_dot_)peak(_dot_)org> writes:

I am trying to do this:

0c
* ^TOlist(_at_)isp\(_dot_)com
* ^Subject:[    ]PATCH:
* ^X-Mailing-List: <list(_at_)isp\(_dot_)com> archive/latest/()\/.*
{

       SUB=`echo $SUBJECT|sed 's/PATCH:\ //g'  |  tr -s ' ' '_'`

       umask 022

You mean, UMASK = 022.


       :0fbw
       | cat - > /info/patches/$MATCH-$SUB.txt

       :0
       /dev/null

Bad bad bad!  The action of a filtering recipe should always some output.
If it doesn't, then it shouldn't be a filtering recipe!

        :0 bw
        | cat - > /info/patches/"$MATCH-$SUB".txt

With this you don't need that extra /dev/null recipe.


}

And it works just fine, until someone uses a weird character in the Subject  
line, like

      Subject: PATCH: $(VAR) installation

I assume this is because of the '$'.... Is there a workaround?


What doesn't work about it?  Unless you shell is totally broken, the
above recipes should work fine.


Philip Guenther

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