Updates :
Yes, I know, there are lot of english mistakes in this text. If you would like to correct them, feel free to mail me or to post in the forum....
Some interesting rulesets for Spam Assassin have been written, and they are updated very often (see also SA webpage in French). So it became very interesting to have a which does it for you, and someone wrote the RulesDuJour utility. But this utility lacks a GPG support !! So I wrote mine, using an apt-get like syntax, which also has some more features (like handling uncompatible rulesets).
Rule-get is also aware of incompatibles rulesets, and rulesets which includes other rulesets (such as the SARE HTML ruleset, which exists as a big file or a file with all 4-in-1). With time, some rulesets became obsoletes. The latest version of rule-get should handle more or less cleverly the obsoletes rule it installed, by deleting them and installing replacement rulesets if they exist. Can RulesDuJour do that ? I don't think so.
Imagine you automatically download everyday some ruleset. You don't manually check what's in the ruleset. So what if some spammer manages to crack the server which hosts those webpages ? He might put there some rules which would allow all his spams to get through. But he might also write some rules in order to tag all your mails as spams (except his spams). So would be the best way to loose some mails. With GPG support, it would need also need the spammer to do a false signature (should be impossible) or to get the GPG key of the guy who wrote the rule with his passphrase (should be impossible also).
For the moment, the only signed rules are Robert Menschell ones at SARE and mines (French rules (GPG Signature) and airmax.cf (GPG Signature)).
If you want to install rule-get on a Debian (unstable) distribution, you just need to install those packages : spamassassin, libwww-perl, libconfig-inifiles-perl, gnupg
. Or as root, just type apt-get install spamassassin libwww-perl libconfig-inifiles-perl gnupg
. Sorry no Debian package for rule-get, but you just need to download one file (see after).
I don't know for other distributions and unixes, but feedback would be appreciated.
Just download the Perl script : rule-get, and (optionnal) it's GPG signature. Check the signature, and take a text editor to ensure it's not a worm and that there is no backdoor. If needed change the $real_path variable ; you might want to use /etc/mail/spamassasin or /var/amavisd/etc/mail/spamassassin with a chrooted amavisd. So the line :
my $real_path="/etc/spamassassin";Would become :
my $real_path= "/etc/mail/spamassassin";
Make it executable (chmod +x rule-get), and copy the rule-get to a directory in the $PATH like /usr/local/sbin (not needed, but it's preferable). Now you are ready for downloading the ini file, so just type (as root, did I say you must be root for using it ?):
rule-get get-rulesThis will
rule-get list
rule-get install RuleName1 RuleName2, etc...Where RuleName1, RuleName2, etc are the name of rulesets. ex :
rule-get install French rule-get install French BackHair Weeds2 ChickenPox AntiDrug
rule-get view installedOk, the new view option has also other usefull options :
rule-get show avail : shows availables (non-obsolete) rulesets rule-get show installed : shows installed rulesets rule-get show might_install : shows only rulesets which might be installed rule-get show uninstalled : shows uninstalled non-obsoletes rulesets rule-get show all : shows all rulesets rule-get show obsoletes : shows obsoletes rulesets
If you want to updates installed ruleset (by rule-get), juste type :
rule-get updateThis will recognize all installed rulesets, and install new version if they are available, and the GPG key matches.
You will probably find usefull to do this on a daily basis, so add something like this in your cron (edit by crontab -e) :
# Get latest SpamAssassin rules. 42 4 * * * /usr/local/bin/rule-get update
rule-get remove RuleName1 RuleName2, etc...(Where RuleName1, RuleName2, etc are the name of rulesets, like for the install command).
rule-get remove-all
rule-get get-rulesLike you did when you installed rule-get :-). Next time you will do an update, it might also obsolete some old rules, and possibly install new ones instead of the olds. If you don't want update to handle obsolete rulesets, use soft-update :
rule-get soft-updateIf you prefer to delete the obsolete instead of replacing them with new ones, do a
rule-get remove-obsoletesbefore the update.
Rulesets are stored in the rules.ini file, which is located in your $real_path directory. Please don't touch this file !! It will be erased the next time you will update the list of rulesets. Just add your new rulesets in your $HOME/.rules.ini file. But I would be pleased to add the new ruleset to the common rules.ini if you inform me that a new ruleset exist.
Too lazy to write this section, just look at the existing rules.ini files, it shouldn't be too difficult to understand. Ok, with newest improvements it should it is a little more difficult, but nothing difficult. With latest versions, saying a is uncompatible with will also mean b is uncompatible with a. Saying ruleset a includes ruleset b also means you can't install b if a is already installed.
free online samples fo cialis tramadol famvir allegra cialis how does cialis affect a woman reviews of cialis cialis holland cialis viagra levitra tramadol cialis recomendation buy cialis buy cialis online dreampharmaceuticals cialis in australia is generic cialis legal average intake of cialis cialis newsletter buy cialis online online a href cialis zestril interactions cialis independent review how cialis tadalafil works viagra cialis herbal samples cialis viagra compare generic cialis online pharmacy professional cialis cialis next day comments about generic cialis cialis and commercial topic 3644 cialis
Generate love powerlessness can be caused neurologic, ok pit the vascular, medicamentous and look at reasons which are the innate manner erectile dysfunctions. There is a psychogenic pioneer more nevertheless again, at which miscreant with erection weigh on.
buy generic cialis without credit cards cialis to buy prices generic cialis cialis overnigh cialis tadalafil uk 1buy cheap cialis regalis generic cialis acheter cialis generic cialis cheapest lowest price cialis brand verses generic cialis generic viagra versus cialis pills viagra cialis free cialis viagra australia supply 1 drug cialis profession d ducateur sp cialis vardenafil viagra cialis impotence drug cialis pills cialis free samples no prescription cialis overnight delivery 5 tadalafil cialis cialis sue cialis generic cheapest cialis faqs cialis safety
Generate love impotency can be caused neurologic, prearranged the vascular, medicamentous and village reasons which are the innate shadow erectile dysfunctions. There is a cerebral loam more regularly, at which puzzler with erection be up to to ditty’s feet.
Apparently the rules.ini has been removed from the server.
I contacted the author and got no responce.
We may consider this project dead.
I was able to get rule-get to work with Windows using ActiveState’s ActivePerl 5.8.7.813, including the signature checks. Here’s what you need to do:
1. Download ActiveState ActivePerl, if you don’t have it, and make sure to get the most current version, install using the default settings
http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl
2. Download GNUPG
http://www.gnupg.org
3. Add the directory where you install GNUPG to your PATH environment variable
4. Download the config-inifiles project (it’s a tarball, so you’ll need something like PowerArchiver to extract it)
http://sourceforge.net/projects/config-inifiles/
Extract the tarball to c:\Perl\Lib (unless you put Perl somewhere else). Because Windows doesn’t have symbolic links, you’ll have to rename the extracted directory "c:\Perl\Lib\Config-IniFiles-2.38" to "c:\Perl\Lib\Config" (there’s probably a better way to do this)
5. In the rule-get script, change the $real_path to the path where SpamAssassin is installed. Also, either create a directory called "/tmp" or change instances of "/tmp" to a different temporary directory (I created a new variable to hold the temporary directory, set it at the beginning and substituted it in the script). Also, if you backslashes instead of forward slashes, make sure to double them.
6. Finally, find the line that says open(FILE, "> $filename"); and add the line binmode(FILE), like:
open(FILE, "> $filename"); binmode(FILE)
same with:
open(SIG, "> $filename.sig"); binmode(FILE);
If you don’t do this, PERL in Windows will add carriage returns to line feeds and the signatures won’t work.
If anybody wants, I’d be happy to send you the modified script that should work under Unix or Windows.
Very nice package. Here are some more rule definitions I just coded up to help customize my installation. Also, the docs could help clarify exactly where should $real_path point? I assume it points to the place where local.cf is installed.
Here are my rules.ini additions:
[SARE_uri_0] Description=Looks for spamsign in URI links within emails (set 0) URL=http://www.rulesemporium.com/rules/70_sare_uri0.cf LocalName=70_sare_uri0.cf Uncompatible=SARE_uri
[SARE_uri_1] Description=Looks for spamsign in URI links within emails (set 1) URL=http://www.rulesemporium.com/rules/70_sare_uri1.cf LocalName=70_sare_uri1.cf Uncompatible=SARE_uri
[SARE_uri_3] Description=Looks for spamsign in URI links within emails (set 3) URL=http://www.rulesemporium.com/rules/70_sare_uri3.cf LocalName=70_sare_uri3.cf Uncompatible=SARE_uri
[SARE_EvilNumbers_0] Description=Addresses and phone numbers harvested from spam (set 0) URL=http://www.rulesemporium.com/rules/70_sare_evilnum0.cf LocalName=70_sare_evilnum0.cf ;KeyID=0x1129F0D3 SafeNess=1
[SARE_EvilNumbers_1] Description=Addresses and phone numbers harvested from spam (set 1) URL=http://www.rulesemporium.com/rules/70_sare_evilnum1.cf LocalName=70_sare_evilnum1.cf ;KeyID=0x1129F0D3 SafeNess=1
[SARE_EvilNumbers_2] Description=Addresses and phone numbers harvested from spam (set 2) URL=http://www.rulesemporium.com/rules/70_sare_evilnum2.cf LocalName=70_sare_evilnum2.cf ;KeyID=0x1129F0D3 SafeNess=1
[SARE_obfu] Description=Looks for various tricks spammers use to hide their message from spam filters URL=http://www.rulesemporium.com/rules/70_sare_obfu.cf LocalName=70_sare_obfu.cf
[SARE_obfu_0] Description=Looks for various tricks spammers use to hide their message from spam filters URL=http://www.rulesemporium.com/rules/70_sare_obfu0.cf LocalName=70_sare_obfu0.cf Uncompatible=SARE_obfu
[SARE_obfu_1] Description=Looks for various tricks spammers use to hide their message from spam filters URL=http://www.rulesemporium.com/rules/70_sare_obfu1.cf LocalName=70_sare_obfu1.cf Uncompatible=SARE_obfu
hi
first: i’ve tried rule-get and i like it much!
2nd: isn’t there a "quiet" mode for using the script with cron. so that if i use it in the cron i’m not interested in the default messages of updated files mailed to me every day... i’m only interested in error reports of things that didn’t work out?
thanks for such a great tool KoS
After installing a rule, I run spamassassin --lint and receive errors like:
warning: score set for non-existent rule SARE_FREE_WEBM_Zwallet
warning: rule ’IE_ADDRESS_SPOOF_EXPLOIT’ is over 22 chars
warning: description for RCVD_IN_AHBL is over 50 chars
Should I be concerned?
Regards,
Allen Miller
These are only warning which appear with SA 3.0... I am aware of them and will correct as soon as I find some free time.
Simply do as if they didn’t exist.
Hello,
I get this strange error running this script saying:
Not enough arguments for mkdir at line 701, near "$work_directory;"
Any ideas ? Thankx in advance.
(Je parle aussi le français, je uis du luxembourg)
Hi.
First of all, thanks for publishing your script. However, it is advertised at various places as an apt-get like program for spamassassin-rulesets. It hit me that it actually performs very similar to apt-get, but uses different commandline options to do the tasks (or the same commandline options have a different meaning), so I patched it to use a more apt-get like command syntax. Namely I replaced the following original items (left side) with the apt-get like items (right side):
get-rules -> update
update -> dist-upgrade
soft-update -> upgrade
No other changes were made, except for a little reformating of the help message. I found these far less confusing. For "get-rules", I installed "update" as an alias to the original command. If you are interested in the diff, please contact me.
Hello, Help, i installed as described, but get following error on my Suse 7.3:
./rule-get get-rules $Id: rule-get,v 1.24.1.8 2004/08/12 02:00:21 airmax Exp airmax $ Copyright (C) 2003-2004 Maxime Ritter. For complete infos, see http://maxime.ritter.eu.org/rule-get
Getting latest rules Please wait while downloading... Getting author’s GPG key gpg: Invalid option "--no-auto-check-trustdb" Getting latest rules.ini file gpg: Invalid option "--no-auto-check-trustdb" Something went wrong: -1
Any help is apprechiated. kr Michael
Which is your version of GPG ? (output of ‘gpg --help’).
If your GPG isn’t very recent (at least 1.2.1), you might need to upgrade GPG.
Salut ! J’ai un probléme avec le rule-get. Je suis sous un Linux RedHat 7.3, avec postfix, amavisd et spammassassin (v.2.63). quand je lance la commande "rule-get get-rules", j’obtiens:
=[ Spam Assassin rule-get by Maxime Ritter ]=- http://maxime.ritter.eu.org/article.php3?id_article=10 $Id: rule-get,v 1.23 2004/04/26 22:01:33 airmax Exp airmax $ Getting latest rules Please wait while downloading... Getting author’s GPG key gpg: requête de la clé 7A107F9E de wwwkeys.eu.pgp.net... gpg: clé 7A107F9E: nom d’utilisateur en double fusionné gpg: clé 7A107F9E: n’a pas changé gpg: Quantité totale traitée: 1 gpg: inchangée: 1 Getting latest rules.ini file Impossible de trouver un chemin de confiance valide jusqu’à la clé. Voyons si nous ne pouvons pas assigner quelques indices de confiance manquants. Aucun chemin menant vers une de nos clés n’a été trouvé.
gpg: Signature faite lun 26 avr 2004 20:51:57 UTC avec une clé DSA ID 7A107F9E gpg: Bonne signature de "Maxime Ritter
Hi,
It seems there is a problem in the way you use the option -default of Config::IniFiles in the case one has a local /.rules.ini
I just restarted using SA, and discovering/playing around with the tools available. To run rule-get, I installed the last Config::IniFiles, version 2.38 and the documentation says that what follow the option default is a section, not a filename:
-default section
Specifies a section to be used for default values. For example, if you look up the "permissions" parameter in the "users" section, but there is none, Config::IniFiles will look to your default section for a "permissions" value before returning undef.
I’ll follow-up if I find a workaround.
Olivier (en français pour la suite en privé)
Why do I get this:
root@neptune: # ./rule-get get-rules
=[ Spam Assassin rule-get by Maxime Ritter ]=-
http://maxime.ritter.eu.org/article.php3?id_article=10
$Id: rule-get,v 1.23 2004/04/26 22:01:33 airmax Exp airmax $
Getting latest rules
Please wait while downloading...
Getting author’s GPG key
gpg: can’t get key from keyserver: Connection timed out
gpg: Total number processed: 0
Getting latest rules.ini file
gpg: Signature made Mon Apr 26 22:51:57 2004 CEST using DSA key ID 7A107F9E
Searching for GPG keys using keyserver
root@neptune: #
French Only :
C’est un peu ce dont j’avais peur avec ma gestion de GPG crados... Je vais voir s’il y a moyen d’y remedier facilement, le problème provenant du fait que tu ton GPG cause en Français et non en Anglais.... Sinon, si tu connais une manière pas trop crados d’accéder a GPG via Perl, je suis preneur aussi :-)))
Sorry, I don’t know about a SA rule update script for windows. It’s so much easier to write scripts for Unix :-)).
If you know a little bit Perl, you may try to adapt the script yourself to ActivePerl....
It shouldn’t be too much difficult to do so if you change the directory names and remove the GPG related stuff.
Make it executable (chmod -x rule-get), and copy the rule-get to a directory in the $PATH
Should read chmod +x rule-get
thanks for making this available to peeps.
BeernuT
You can use the rename function call when the two locations are on different file systems. Many people put /tmp on its own file system so that if /tmp gets filled, it doesn’t bork the rest of the system.
You probably want to use File::Copy to move the file over. It’s a part of the base Perl distribution. I can provide you a patch if you’d like.
Darren Stalder sa-rule-get-AT-wolfieboy-DOT-org
rule-get gives the following permission error. What might be the problem? (Of course I used it as root.) I use Debian unstable/testing.
=[ Spam Assassin rule-get by Maxime Ritter ]=- http://maxime.ritter.eu.org/article.php3?id_article=10
Getting latest rules Please wait while downloading... Getting author’s GPG key gpg: key 7A107F9E: "Maxime Ritter
I’m getting the same error, i am running as root. I’m out of ideas.... If you have a solution for this, please share, I’m at jeff@ soren.com (no space)... Here’s my output...
— - Start ---
Getting author’s GPG key
gpg: key 7A107F9E: "Maxime Ritter
gpg: Total number processed: 1
gpg: unchanged: 1
Getting latest rules.ini file
Error while moving file /tmp/rules68123.ini to /etc/mail/spamassassin. Check permissions
Searching for GPG keys using keyserver
Failed to open /etc/mail/spamassassin/rules.ini: No such file or directory at /usr/bin/rule-get line 220
Can’t call method "Sections" on an undefined value at /usr/bin/rule-get line 223.
— - End ---
Hi, Under root :
toto:/$HOME/titi# ./spam-get-rules install French
=[ Spam Assassin rule-get by Maxime Ritter ]=- http://maxime.ritter.eu.org/article.php3?id_article=10
Install/Upgrade of French ruleset Error while moving 65_french.cf to /etc/mail/spamassassin/65_french.cf. Check permissions. French : is now up to date
So ? no idea ? Thx
Strange bug.
Did you change the realpath variable at the beginning of the file ? Under debian, it should be /etc/spamassasin (which is the default).
I first thought that /etc/mail/spamassassin doesn’t exist, but in that case it shouldn’t be able to read the rules.ini file (which is in this directory). Or you’re maybe downloaded by hand the file rules.ini and put it to your /.rules.ini ? (are my explaination so much bad ?)
Are you sure you were root ?
Does the directory /etc/mail/spamasssin exist ? Why don’t you use /etc/spamassin which is the default under all debian packages I know off ?
Trying to use rule-get on a debian sid leads into :
# rule-get get-rules
=[ Spam Assassin rule-get by Maxime Ritter ]=-
http://maxime.ritter.eu.org/article.php3?id_article=10
Getting latest rules
And then nothing happens....
I think something is wrong somewhere... but...