1# THE SPAMBOUNCER 2# 3# Version 3.0 beta 2 4# Last Updated 3/20/2017 5# 6# Copyright (C) 1996-2016 by Catherine A. Jefferson. If 7# you abide by the Free Software Foundation's COPYING 8# principles with this document and software, you're home free, 9# but don't try to copyright it yourself or sell this 10# information. 11# 12# Installation instructions can be retrieved at: 13# 14# http://www.spambouncer.org/ 15# 16 17########################################################################## 18 19# SET INITIAL INTERNAL VARIABLES 20# 21# This variable is used several places by the SpamBouncer logging 22# feature. It is defined here so that it's easy to find and update 23# once, in one place. 24 25SBVERSION="3.0 alpha (3/20/2017)" 26 27# ADD A HEADER TO THE EMAIL WITH THE SPAMBOUNCER VERSION 28:0 f 29| ${FORMAIL} -A"X-SpamBouncer: ${SBVERSION}" 30 31# Check for Oversized email, and don't try to filter anything above 32# 2 MB in size. 33# 34:0 f 35* > 2048000 36| ${FORMAIL} -A"X-SBPass: Oversized Email" 37 38# Start of :0 E wrapper if email is not oversized. 39:0 E 40{ 41 42# USER-DEFINED VARIABLES SET 43# 44# Checks in the following order for the SpamBouncer user variable 45# settings file, a procmail-format .rc file on the local file system 46# that contains the user's own variable settings in standard Unix 47# shell VARNAME=value name/value pairs, one per line. If it finds 48# the file, it loads it, and skips to the next step. If it does 49# not find the file in any of the designated locations, it assumes 50# that the user defined the necessary variables in the .procmailrc 51# file itself and continues on. 52# 53# * ${SBUSERSETTINGS} 54# * ${SBUSERDIR}/sb-localconfig.rc 55# * ${SBDIR}/user/sb-localconfig.rc 56# * ${HOME}/sb/user/sb-localconfig.rc 57 58:0 59* ! SBUSERSETTINGS ?? ^^^^ 60* ! SBUSERSETTINGS ?? ${HOME}/.procmailrc 61{ 62 :0 63 * ? ${TEST} -f ${SBUSERSETTINGS} 64 { 65 :0 66 * ! SBUSERSETTINGS > 8192 67 { 68 INCLUDERC=${SBUSERSETTINGS} 69 } 70 } 71} 72 73:0 74* SBUSERSETTINGS ?? ^^^^ 75* ! SBUSERDIR ?? ^^^^ 76{ 77 :0 78 * ? ${TEST} -f ${SBUSERDIR}/sb-localconfig.rc 79 { 80 :0 81 * ! SBUSERDIR/sb-localconfig.rc > 8192 82 { 83 INCLUDERC=${SBUSERDIR}/sb-localconfig.rc 84 } 85 } 86} 87 88:0 89* SBUSERSETTINGS ?? ^^^^ 90* SBUSERDIR ?? ^^^^ 91* ! SBDIR ?? ^^^^ 92{ 93 :0 94 * ? ${TEST} -f ${SBDIR}/user/sb-localconfig.rc 95 { 96 :0 97 * ! SBDIR/user/sb-localconfig.rc > 8192 98 { 99 INCLUDERC=${SBDIR}/user/sb-localconfig.rc 100 } 101 } 102} 103 104# CHECK FOR PROPER SETTING OF VARIABLES 105# 106# This script checks to see if the necessary variables are set, and if 107# they are not, sets them to harmless defaults which will minimize the effects 108# of the SpamBouncer program. If you don't set your variables, the 109# SpamBouncer won't do much. :/ 110 111LOCALTAG=no 112 113:0 114* DEFAULT ?? ^^^^ 115{ LOCALTAG=yes } 116 117:0 118* FORMAIL ?? ^^^^ 119{ LOCALTAG=yes } 120 121:0 122* SBDIR ?? ^^^^ 123{ LOCALTAG=yes } 124 125:0 126* LOCALTAG ?? yes 127| ${FORMAIL} -A"X-SBRule: Pass-Bad Config" 128 129# Start of "else" wrapper if critical variables set 130:0 E 131{ 132 INCLUDERC=${SBDIR}/sb2.rc 133} 134# End of :0 E wrapper around Critical Variables check 135 136} 137# End of :0 E wrapper around email that is not oversized. 138