# SpamAssassin - Hashcash rules
#
# Please don't modify this file as your changes will be overwritten with
# the next update. Use @@LOCAL_RULES_DIR@@/local.cf instead.
# See 'perldoc Mail::SpamAssassin::Conf' for details.
#
# <@LICENSE>
# Copyright 2004 Apache Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# </@LICENSE>
#
###########################################################################

# Requires the Mail::SpamAssassin::Plugin::Hashcash plugin be loaded.

ifplugin Mail::SpamAssassin::Plugin::Hashcash

header HASHCASH_20            eval:check_hashcash_value('20', '21')
header HASHCASH_21            eval:check_hashcash_value('21', '22')
header HASHCASH_22            eval:check_hashcash_value('22', '23')
header HASHCASH_23            eval:check_hashcash_value('23', '24')
header HASHCASH_24            eval:check_hashcash_value('24', '25')
header HASHCASH_25            eval:check_hashcash_value('25', '26')
header HASHCASH_HIGH          eval:check_hashcash_value('26', '9999')
tflags HASHCASH_20            nice userconf
tflags HASHCASH_21            nice userconf
tflags HASHCASH_22            nice userconf
tflags HASHCASH_23            nice userconf
tflags HASHCASH_24            nice userconf
tflags HASHCASH_25            nice userconf
tflags HASHCASH_HIGH          nice userconf
describe HASHCASH_20          Contains valid Hashcash token (20 bits)
describe HASHCASH_21          Contains valid Hashcash token (21 bits)
describe HASHCASH_22          Contains valid Hashcash token (22 bits)
describe HASHCASH_23          Contains valid Hashcash token (23 bits)
describe HASHCASH_24          Contains valid Hashcash token (24 bits)
describe HASHCASH_25          Contains valid Hashcash token (25 bits)
describe HASHCASH_HIGH        Contains valid Hashcash token (>25 bits)

# This should NOT be a high score; it's possible for this to happen if
# a mail is sent to a list, and CC'd to you.   However, if it does fire,
# it'll cancel out the hashcash "bonus" rule.
#
header HASHCASH_2SPEND        eval:check_hashcash_double_spend()
describe HASHCASH_2SPEND      Hashcash token already spent in another mail
tflags HASHCASH_2SPEND        userconf

endif   # Mail::SpamAssassin::Plugin::Hashcash
