# @(#) pm-jaempty.rc -- check if message body is empty (nothing relevant)
# @(#) $Id: pm-jaempty.rc,v 2.0 2001/07/27 22:45:50 jaalto Exp $
#
#   File id
#
#       .Copyright (C)  1997-2001 Jari Aalto
#       .$Contactid:    jari.aalto@poboxes.com $
#       .$Created:      1997-11 $
#       .$keywords:     procmail, subroutine, check empty message $
#
#       This code is free software in terms of GNU Gen. pub. Lic. v2 or later
#	Refer to http://www.gnu.org/copyleft/gpl.html
#
#   Description
#
#       This simple includerc will define variable BODY_EMPTY to "yes" or "no"
#       when called like this
#
#           INCLUDERC = $PMSRC/pm-jaempty.rc
#
#   Required settings
#
#       (none)
#
#   Change Log (none)

# ............................................................ &init ...


id    = "pm-jaempty.rc"
dummy = "
========================================================================
$id: init:
"

:0
* !  WSPC ?? [ ]
{
    INCLUDERC = $PMSRC/pm-javar.rc
}

# ........................................................... &do-it ...

BODY_EMPTY = "yes"

#   Every empty line or signarure start is a -1
#
#   Every non-empty line that has characters is +10
#
:0 B
*$  -1^1 ^$s*$|^--
*   10^1 ^.*[a-z]
{
    # no-op. We just count the score value.
}

SCORE = $=

:0
*$ ${SCORE}^0
{
    BODY_EMPTY = "no"
}

dummy = "$id: end:"

# end of file pm-jaempty.rc
