procmail
[Top] [All Lists]

Re: nul detection

1997-12-05 09:01:00

Thu 97-12-04 Rik Kabel <rik(_at_)netcom(_dot_)com> list.procmail
| 
| I have been trying to formulate a recipe which catches a nul, and have
| not been successful. I can catch bel, but similar tests fail for nul.
|
|  SHELL=/bin/sh
|  NUL=`/usr/5bin/echo "\000"`
|  BEL=`/usr/5bin/echo "\007"`

[musings on binary size]

If you want to catch a NULL only _once_, then an awk would be easy.

Easy, but significantly less efficient than a solution within procmail.

If you want to catch it many times in different recipes, then
saving the value to a procmail variables is best, as you just
showed. (I don't know solution for that).

    #   EXIT_SUCCESS  (=0)
    :0 b    
         ^
         |
I think this should be 'B', not 'b'. If the action involves only the
body, a 'b' in addition to the 'B' may be appropriate.

    * ? awk '{if (/\000/){exit 0}else{exit 1}}' 
    {
        # Yay, it had null in the message. Is this bozo sending binary to me?
    }

The problem posed, however, is why nul detection doesn't work within
procmail, while detection of another low-valued character, bel, does
work.

-- 
Rik Kabel          Old enough to be an adult              
rik(_at_)netcom(_dot_)com

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