18 | | Instructions for using sa-update to update both your core SpamAssassin rules and SARE rules can be |
19 | | found [http://wiki.apache.org/spamassassin/RuleUpdates here]. |
| 18 | '''NOTE:''' If you're using the older ''!RulesDuJour'' script for updating your !SpamAssassin rules, you should consider replacing it with sa-update, as ''!RulesDuJour'' is deprecated and no longer being maintained. |
| 19 | |
| 20 | |
| 21 | == Updating !SpamAssassin's Core Rules == |
| 22 | |
| 23 | If you only want to update !SpamAssassin's core rules (i.e. you're not interested in using third-party rules from SARE), you can run sa-update as follows, adding it as a daily cron job. This sequence looks for rule updates on the official !SpamAssassin channel (updates.spamassassin.org), and if it makes any updates it then recompiles the rules for efficiency, tells Maia about any new rules, and restarts amavisd-maia. |
| 24 | |
| 25 | {{{ |
| 26 | sa-update && /usr/bin/sa-compile && /var/amavisd/maia/scripts/load-sa-rules.pl && /sbin/service amavisd restart |
| 27 | }}} |
| 28 | |
| 29 | |
| 30 | == Updating SARE Rules == |
| 31 | |
| 32 | If you also wish to update third-party rules from the !SpamAssassin Rules Emporium, you have a couple of options: |
| 33 | |
| 34 | * [http://saupdates.openprotect.com/ OpenProtect] provides a pre-packaged set of SARE's most conservative (i.e. level-0) rulesets in one convenient channel. This saves you the trouble of having to hand-pick the rulesets you wish to use, but it also limits you to the rules that !OpenProtect has chosen to include, so more aggressive rules with levels 1-4 are not available. This is a good choice for novices and for production environments where conservative rules are favoured. |
| 35 | |
| 36 | * [http://daryl.dostech.ca/sa-update/sare/sare-sa-update-howto.txt DOStech] publishes all of the SARE rulesets in individual channels, allowing you to pick and choose the rulesets you wish to use. This flexibility comes with some complexity however, since it means having to decide which rulesets are appropriate for your site. This is a good choice for advanced mail administrators and power users who want fine-grained control over their SARE updates. |
| 37 | |
| 38 | |
| 39 | === Using !OpenProtect Channels === |
| 40 | |
| 41 | Download the channel's GPG key: |
| 42 | |
| 43 | {{{ |
| 44 | wget http://saupdates.openprotect.com/pub.gpg |
| 45 | }}} |
| 46 | |
| 47 | |
| 48 | Import the GPG key into sa-update's keyring: |
| 49 | |
| 50 | {{{ |
| 51 | sa-update --import pub.gpg |
| 52 | }}} |
| 53 | |
| 54 | |
| 55 | Create a text file (e.g. sare-sa-update-channels.txt) that lists the official !SpamAssassin update channel (updates.spamassassin.org, for your core rules) and the !OpenProtect channel (saupdates.openprotect.com, for the SARE rulesets). |
| 56 | |
| 57 | '''NOTE''': The order of these channels in the text file is important. The ''updates.spamassassin.org'' channel must always be the first channel in the list. |
| 58 | |
| 59 | {{{ |
| 60 | updates.spamassassin.org |
| 61 | saupdates.openprotect.com |
| 62 | }}} |
| 63 | |
| 64 | |
| 65 | You can then run sa-update as follows, adding it as a daily cron job. This sequence looks for rule updates on both channels (!SpamAssassin and !OpenProtect), and if it makes any updates it then recompiles the rules for efficiency, tells Maia about any new rules, and restarts amavisd-maia. |
| 66 | |
| 67 | {{{ |
| 68 | sa-update --gpgkey D1C035168C1EBC08464946DA258CDB3ABDE9DC10 --channelfile /path/to/sare-sa-update-channels.txt && /usr/bin/sa-compile && /var/amavisd/maia/scripts/load-sa-rules.pl && /sbin/service amavisd restart |
| 69 | }}} |
| 70 | |
| 71 | |
| 72 | |
| 73 | === Using DOStech Channels === |
| 74 | |
| 75 | Download the channel's GPG key: |
| 76 | |
| 77 | {{{ |
| 78 | wget http://daryl.dostech.ca/sa-update/sare/GPG.KEY |
| 79 | }}} |
| 80 | |
| 81 | |
| 82 | Import the GPG key into sa-update's keyring: |
| 83 | |
| 84 | {{{ |
| 85 | sa-update --import GPG.KEY |
| 86 | }}} |
| 87 | |
| 88 | |
| 89 | Visit the [http://www.rulesemporium.com/rules.htm SpamAssassin Rules Emporium] and make a list of the rulesets you wish to use. Add the names of these rulesets to a text file (e.g. sare-sa-update-channels.txt), and append ".sare.sa-update.dostech.net" to the name of each ruleset, e.g. ''70_sare_header2.cf'' becomes ''70_sare_header2.cf.sare.sa-update.dostech.net''. |
| 90 | |
| 91 | '''NOTE:''' The first channel in the file ''must'' be ''updates.spamassassin.org''. e.g. |
| 92 | |
| 93 | {{{ |
| 94 | updates.spamassassin.org |
| 95 | 72_sare_redirect_post3.0.0.cf.sare.sa-update.dostech.net |
| 96 | 70_sare_evilnum0.cf.sare.sa-update.dostech.net |
| 97 | 70_sare_evilnum1.cf.sare.sa-update.dostech.net |
| 98 | 70_sare_bayes_poison_nxm.cf.sare.sa-update.dostech.net |
| 99 | 70_sare_html0.cf.sare.sa-update.dostech.net |
| 100 | 70_sare_html1.cf.sare.sa-update.dostech.net |
| 101 | 70_sare_html2.cf.sare.sa-update.dostech.net |
| 102 | 70_sare_html3.cf.sare.sa-update.dostech.net |
| 103 | 70_sare_html_eng.cf.sare.sa-update.dostech.net |
| 104 | 70_sare_header0.cf.sare.sa-update.dostech.net |
| 105 | 70_sare_header1.cf.sare.sa-update.dostech.net |
| 106 | 70_sare_header2.cf.sare.sa-update.dostech.net |
| 107 | 70_sare_header3.cf.sare.sa-update.dostech.net |
| 108 | 70_sare_header_eng.cf.sare.sa-update.dostech.net |
| 109 | 70_sare_specific.cf.sare.sa-update.dostech.net |
| 110 | 70_sare_adult.cf.sare.sa-update.dostech.net |
| 111 | 72_sare_bml_post25x.cf.sare.sa-update.dostech.net |
| 112 | 99_sare_fraud_post25x.cf.sare.sa-update.dostech.net |
| 113 | 70_sare_spoof.cf.sare.sa-update.dostech.net |
| 114 | 70_sare_random.cf.sare.sa-update.dostech.net |
| 115 | 70_sare_oem.cf.sare.sa-update.dostech.net |
| 116 | 70_sare_genlsubj0.cf.sare.sa-update.dostech.net |
| 117 | 70_sare_genlsubj1.cf.sare.sa-update.dostech.net |
| 118 | 70_sare_genlsubj2.cf.sare.sa-update.dostech.net |
| 119 | 70_sare_genlsubj3.cf.sare.sa-update.dostech.net |
| 120 | 70_sare_genlsubj_eng.cf.sare.sa-update.dostech.net |
| 121 | 70_sare_unsub.cf.sare.sa-update.dostech.net |
| 122 | 70_sare_uri0.cf.sare.sa-update.dostech.net |
| 123 | 70_sare_uri1.cf.sare.sa-update.dostech.net |
| 124 | 70_sare_uri2.cf.sare.sa-update.dostech.net |
| 125 | 70_sare_uri3.cf.sare.sa-update.dostech.net |
| 126 | 70_sare_uri_eng.cf.sare.sa-update.dostech.net |
| 127 | 70_sare_obfu0.cf.sare.sa-update.dostech.net |
| 128 | 70_sare_obfu1.cf.sare.sa-update.dostech.net |
| 129 | 70_sare_obfu2.cf.sare.sa-update.dostech.net |
| 130 | 70_sare_stocks.cf.sare.sa-update.dostech.net |
| 131 | }}} |
| 132 | |
| 133 | |
| 134 | You can then run sa-update as follows, adding it as a daily cron job. This sequence looks for rule updates on all channels (!SpamAssassin and the DOStech channels), and if it makes any updates it then recompiles the rules for efficiency, tells Maia about any new rules, and restarts amavisd-maia. |
| 135 | |
| 136 | {{{ |
| 137 | sa-update --gpgkey 856AA88A --channelfile /path/to/sare-sa-update-channels.txt && /usr/bin/sa-compile && /var/amavisd/maia/scripts/load-sa-rules.pl && /sbin/service amavisd restart |
| 138 | }}} |