procmail
[Top] [All Lists]

Condition with BODY length?

1997-07-16 16:42:00

Is there any way I can control execution of action line with length of BODY?

What I want to do is to 
split BODY into less-than-100-char chunks and forward them to pager.
And I certainly do not want to send out empty messages.

    :0bfw
    | perl -pe 's/\n/ /g'

    :0bc
    BODYLEN=|formail -I ""|wc -m 

    :0Wifbc
    * ? ($BODYLEN > 200) <===== ANY VALID RECIPE LIKE THIS?
    |cut -c201-300 && echo > splitout3

LOOP style(ex. i=1 to $BODYLEN/100) would be even more appreciated:-)

cut program seems to return "0" even if it could not cut as expected
so I could not use its exitcode for condition.

_/_/_/      Mitsuru FURUKAWA      _/_/_/
_/_/_/        Tokyo, Japan        _/_/_/
_/_/_/     mailto:furu(_at_)009(_dot_)com    _/_/_/
_/_/_/  http://www.009.com/furu/  _/_/_/