=============================================
# A SAMPLE .PROCMAILRC FILE FOR NOVICES
# Written by Catherine Hampton
#
# Version 2.2
# Updated 06/21/2005
#
# NOTE: THIS SAMPLE PROCMAIL CONFIGURATION FILE IS NOT PART OF
# THE OFFICIAL SPAMBOUNCER DISTRIBUTION. IT IS PROVIDED AS A
# CONVENIENCE FOR THOSE WHO ARE UNFAMILIAR WITH PROCMAIL.
#
# Those who know Procmail can write their own .procmailrc files,
# or customize this to their heart's content. :)
#
# Released to the Public Domain.
#
#
# VARIABLE SETTINGS SECTION
#
# Modify the variable settings here to fit your system.

LOGFILE=$HOME/.procmail.log
LOCKFILE=$HOME/.lockmail

# SpamBouncer Configuration Defaults variable
#
# Change this to "Lite" if you want to reduce the SpamBouncer's
# load on your system significantly. Change this to "Analyze"
# if you want to check each spam against all internal lists of
# known spammers, and don't mind a more loaded system and slower
# delivery of email.
#
SBCONFIG=Lite
#SBCONFIG=Default

# SpamBouncer System Defaults variable
#
# Change this to "Solaris" if your server is a Sun system running
# Solaris. Change this to "Sun" if your server is a Sun system
# running SunOS.
#
SBSYSCHECK=Generic

# Internal settings
#
# Don't mess with LINEBUF or VERBOSE unless you know what you are doing.
# You can modify the PATH statement if there needs to be different or
# other directories to programs that SpamBouncer uses.
#
LINEBUF=8096
PATH=${HOME}/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin
VERBOSE=off

# Variables for programs
#
# Make sure you set the proper paths for FORMAIL and SENDMAIL.
# Different systems often put these programs in different
# locations, so you *MUST* check this for your system.
#
# The other programs should be on your path if your PATH statement
# is configured properly, but if you prefer to use specific versions
# of theseprograms, you can explicitly set them to a particular path and
# program name individually.
#
SHELL=/bin/sh
CAT=cat
CD=cd
DATE=date
ECHO=echo
FORMAIL=/usr/bin/formail
GREP=fgrep
LS=ls
RM=rm
SBHOST=host
SED=sed
SENDMAIL=/usr/sbin/sendmail
TEST=test
R=tr
WHOIS=whois

# Default program & file locations
#
# Make sure that *ALL* of these are correct, or you'll really
# screw up your mail delivery! (You will probably need to
# create a directory named 'backup' inside of your MAILDIR
# directory.)
#
# NOTE: You must substitute your own DEFAULT mailbox for
# "/var/mail/user".
#
DEFAULT=/var/mail/${USER}
#DEFAULT=${HOME}/Mail/inbox
MAILDIR=${HOME}/Mail
LOGFILE=${MAILDIR}/log/log.`date +%y-%m`
#SBDIR=/var/qmail/.sb
SBDIR=${HOME}/.sb
BACKUP=${MAILDIR}/backup

# Spambouncer Configuration Settings
#
# Add variables for any blocklists, whitelists, or SpamBouncer features
# you want to enable or disable here. I don't recommend turning on a
# lot of extra blocklists, however. The default set, plus the DSBL and
# SURBL lists, provides wonderful protection and won't add load to your
# system or slow mail delivery.
#
ADMINFOLDER=${DEFAULT}
#ADMINFOLDER=${MAILDIR}/admin
ALTFROM=${USER}@cns.s.u-tokyo.ac.jp
#BLOCKFOLDER=${MAILDIR}/block.incoming
BLOCKFOLDER=${DEFAULT}
BLOCKLEVEL=5
BLOCKREPLY=SILENT
#BLOCKREPLY=NOTIFY
BULKFOLDER=${DEFAULT}
BYPASSWD=abracadabra
PATTERNMATCHING=SILENT
SBCONFIG=Default
SBDELIVERY=FILE
#SBDELIVERY=FILTER
SPAMFOLDER=${MAILDIR}/maybe-spam/.
#SPAMFOLDER=${DEFAULT}
#SPAMFOLDER=${MAILDIR}/spam.incoming
#SPAMFOLDER=${MAILDIR}/spam/spam.`date +%y-%m`
SPAMLEVEL=20
VIRUSFOLDER=/dev/null

# WHITELISTS
#
# Enable the following whitelists to allow email from
# servers listed on them. It will reduce false positives without
# appreciably increasing spam.
#
# Note: Bonded Sender Plus (BSPCHECK=yes) and the Habeas
# Whitelist (HABEASVERIFIED=yes) are enabled by default. To
# disable them, set the variables equal to "no". If you want
# to relax the Bonded Sender setting to allow all opt-in
# email rather than only confirmed opt-in email, you can set
# IBSCHECK=yes.
#
# The IADB is enabled at the level "COI", which allows email from
# servers that use confirmed opt-in methods only. If you
# want to relax the setting further, you can set
# IADBCHECK=OI to allow all opt-in email. If you want to
# disable it, you can set IADBCHECK=no.
#
Set JAPANESE=yes
BSPCHECK=yes
HABEASVERIFIED=yes
IADBCHECK=COI
IBSCHECK=no
# BELOW ARE THE PROCMAIL RECIPES
# DON'T EDIT ANYTHING BETWEEN THIS LINE AND THE LINE LOWER
# DOWN THAT SAYS YOU CAN EDIT AGAIN. :)
## To use spambouncer, uncomment from here-----------------------
#
# # Create a backup cache of 1000 most recent messages to catch
# # mistakes.
# #
# :0 c
# ${BACKUP}
#
# :0 ic
# | ${CD} ${BACKUP} && ${RM} -f dummy `${LS} -t msg.* | ${SED} -e 1,50d`
#
# # Regenerate "From" lines
# :0 fhw
# | ${FORMAIL} -I "From " -a "From "
#
# # Call SpamBouncer, but make sure you skip any REALLY big emails
# # (over 2 MB) first, before they crash it. :)
# :0 f
# * > 2048000
# | ${FORMAIL} -A"X-Note: Oversize/Not Filtered"
#
# :0 E
# { INCLUDERC=${SBDIR}/sb.rc }
#
#
# # OKAY, YOU CAN EDIT AGAIN. :)
#
## to here-------------------------------------------------

###################################################################
# BELOW ARE BSFILTER RECIPES
#=== using bsfilter
#BSFILTER=/usr/local/bin/bsfilter
#SUBJECT="TEST"
# bsfilterでSPAMフラグとSPAM率を付ける。
# insert *SPAM* flag and probability
#:0 fw: bsfilter.lock
#| $BSFILTER --header-prefix "SPAM(BS)" --mark-spam-subject --spam-subject-pref\ \
ix "***SPAM***" --homedir /usr/local/bsfilter-1.0.14/.bsfilter/ -a --pipe --ins\ \
ert-flag --insert-probability
#
# # SPAMは${SPAMFOLDER}へ送る。
# # send the SPAM mail to ${SPAMFOLDER}.
#:0
#* ^X-Spam\(BS\)-Flag: Yes
#${SPAMFOLDER}
#
# ABOVE ARE BSFILTER RECIPES
###################################################################

###################################################################
# BELOW ARE SPAMASSASSIN RECIPES
#SPAMASSASSIN=/usr/bin/spamc
SPAMASSASSIN=/usr/bin/spamassassin
:0 fw: spamassassin.lock
# Do not judge the mail which bsfilter judged as a spam.
*!^X-Spam\(BS\)-Flag: Yes
|${SPAMASSASSIN}

# # send the SPAM mail to ${SPAMFOLDER}.
:0
* ^X-Spam-Flag: YES
${SPAMFOLDER}

# ABOVE ARE SPAMASSASSIN RECIPES
###################################################################

# Do whatever you do to deliver the email below. If you want,
# you can change the SBDELIVERY variable to SBDELIVERY=FILTER
# and uncomment the INCLUDERC line below. Modify the line to
# point to the directory where you store your auxiliary Procmail
# scripts. (Should not be in your HOME directory.)
#
# Otherwise, write your own delivery scripts!

#INCLUDERC=${SBDIR}/auxiliary/delivery.rc
###################################################################
# To or Cc に${USER}@cns.s.u-tokyo.ac.jpがあるときのみ転送。
# (つまり、メーリングリストは転送しない。)
# SPAM率>0.4以上の場合も転送しない。
#:0 c
#* ^(To|Cc):.*${USER}@cns.s.u-tokyo.ac.jp
#* ! ^Subject:.*SPAM
#* ! ^X-Spam-Probability: *(1|0\.[4-9])
#! [user name]@cns.s.u-tokyo.ac.jp
###################################################################