#!/bin/bash # Version 1.08 ## This file is a wrapper for rules_du_jour that is intended to hold all settings you wish ## to keep forever, even after updating to a new rules_du_jour version. The intention is ## that you configure and install this file only once. If you update the main rules_du_jour ## script your settings will still be intact here. ## If you have any feedback (for instance, if the instructions do not make sense) feel free ## to email me. cmtspamassassinrdjsomeone.dhs.org # my_rules_du_jour Usage instructions: # 1) Add zero or more custom rulesets to this file in a manner similar to how rulesets are # listed in the main rules_du_jour script. Make sure, however, that all the custom # ruleset's you add use index numbers 1000 or greater. # Note: You should not duplicate the rulesets already listed in the main script # (rules_du_jour) unless you are customizing some portion of those rulesets such as # the munge script. # # 2) Choose rulesets to update (TRUSTED_RULESETS below). Include both stock and custom rulesets names. # # 3) Configure Local settings (SA_DIR, MAIL_ADDRESS, SA_LINT, SA_RESTART, PERL, GREP below) # The settings that are configured in this file (my_rules_du_jour) take precedence over # the settings found in the main script (rules_du_jour). This means there is no need # to modify the main script if you have fully configured this one. # # 4) Run *this* script (instead of running rules_du_jour) periodically. # 4a) To run manually, first make it executable (chmod +x my_rules_du_jour) then execute (./my_rules_du_jour) # 4b) To run via cron, edit your cron (crontab -e) and add a line such as this: # 03 1 * * * /root/bin/my_rules_du_jour # The crontab line above runs /root/bin/my_rules_du_jour at 1:03 every day. (choose a different time, please) # Make sure the user who's crontab you are editing has permission to write files to the SA config dir. # # 5) You may now download and install updated versions of the main rules_du_jour script without # worrying about re-configuring your custom settings. As new rulesets are added to the main # rules_du_jour script, you can make them active in your local config by editing $TRUSTED_RULESETS. # IMPORTANT! Edit the TRUSTED_RULESETS line to choose which RuleSets to update TRUSTED_RULESETS="FOOBAR BARBAZ"; # Both FOOBAR and BARBAZ are non-existant rulesets. # Please choose for yourself which sets you want to track.. # Here are some of the rulesets included in the 1.12 release: # "MRWIGGLY BIGEVIL TRIPWIRE ANTIDRUG EVILNUMBERS BOGUSVIRUS SARE_ADULT SARE_FRAUD SARE_BML SARE_RATWARE SARE_SPOOF SARE_BAYES_POISON_NXM SARE_OEM SARE_RANDOM SARE_HEADER_ABUSE SARE_CODING_HTML"; #### Local SpamAssassin/system Settings #### #### Modify these to match your system. #### # Note that these settings take precedence over the settings found in the stock rules_du_jour. SA_DIR="/etc/spamassassin"; # Change this to your SA local config # directory, probably /etc/mail/spamassassin. # For amavisd chrooted, this may be: # /var/amavisd/etc/mail/spamassassin MAIL_ADDRESS="root"; # Where do Email notifications go SINGLE_EMAIL_ONLY="true"; # Send only one notification email per run SA_LINT="spamassassin --lint"; # Command used to lint spamassassin SA_RESTART="/etc/init.d/spamassassin restart"; # Command used to restart spamd # May be /etc/rc.d/init.d/spamassassin restart # For amavisd, may be /etc/init.d/amavisd restart WGET="wget -N" # Location (and flags) of the wget program PERL="perl"; # Location of the perl program GREP="grep"; # Location of the grep program # (solaris users may want to point this to gnu grep) RULES_DU_JOUR_SCRIPT="/root/bin/rules_du_jour"; # Where the full rules_du_jour script is located DONT_CHECK_FOR_RDJ_UPDATES= # Set this to "true" to skip checking for # updates to the Rules Du Jour script itself #### End Local Settings #### # These are bash Array Variables ("man bash" for more information) declare -a CF_URLS; declare -a CF_FILES; declare -a CF_NAMES; declare -a PARSE_NEW_VER_SCRIPTS; declare -a CF_MUNGE_SCRIPTS; ############################################ #### Begin Personal Rules File Registry #### ############################################ # If you add more RuleSets to your own registry, please contribute the settings to the www.exit0.us wiki # http://www.exit0.us/index.php/RulesDuJourRuleSets # IMPORTANT: # To avoid conflicts between your own registry and the standard # registry (distributed with the rules_du_jour script), I recommend that you # start your personal registry index numbers at 1000 or greater. #### Here is a (fictional) sample of a custom ruleset: FOOBAR. #### FOOBAR=1000; # Index of FooBar data into the arrays is 1000 CF_URLS[1000]="http://sandgnat.com/rdj/foobar.404.cf"; CF_FILES[1000]="foobar.cf"; CF_NAMES[1000]="Foo's Bar"; PARSE_NEW_VER_SCRIPTS[1000]="${PERL} -ne 'print if /^\s*#.*(vers?|version|rev|revision)[:\.\s]*[0-9]/i;' | sort | tail -1"; BARBAZ=1001; # Index of BarBaz data into the arrays is 1001 CF_URLS[1001]="http://sandgnat.com/rdj/barbaz.404.cf"; CF_FILES[1001]="barbaz.cf"; CF_NAMES[1001]="Bar's Baz"; PARSE_NEW_VER_SCRIPTS[1001]="${PERL} -ne 'print if /^\s*#.*(vers?|version|rev|revision)[:\.\s]*[0-9]/i;' | sort | tail -1"; ############################################ #### End Personal Rules File Registry #### ############################################ # This command invokes the standard rules_du_jour script [ -f "${RULES_DU_JOUR_SCRIPT}" ] && \ . ${RULES_DU_JOUR_SCRIPT} || \ echo "ERROR: could not find rules_du_jour at configured path: ${RULES_DU_JOUR_SCRIPT}";