We describe here one possible counter measure against the increasing flow of SPAM mails.
This is based on three packages wich have been installed on our system:
New is that this version of spamassassin can learn!!
BUT YOU WILL HAVE TO START IT AND TEACH IT !!
2- What to do
If you do not have this file, then this is a minimum one that you can create with the following commands:
your_UNIX_machine% cd your_UNIX_machine% cat >.procmailrc SHELL=/bin/sh MAILDIR=$HOME/mail_folders INCLUDERC=/usr/pack/spamassassin-2.60-ds/procmail.inc :0: * ^X-Spam-Status: Yes spams ^D <-- this means Control + D keys at the same time
Notice that the line above consists of four strings:
"star" "blank" "^" "X-Spam-Status: Yes"
Now all mails which are detected as being a SPAM will be written into
your subdirectory
~/mail_folders/ with the name spams
PLEASE, from time to time go and clear up this file !!!!!!!
If you do NOT wish to store (and thus be able to check) those mails, then substitute /dev/null for spam in the last line of ~/.procmail above. (This is NOT recommended.....)
Please, feel free to look at my /home/ballisti/.procmailrc file
For those of you who want to know more:
AS YOU SHOULD DO IT IN OUR SYSTEM:
Teach to recognise spam mails:
bigbang:ballisti:[ballisti]:93 % cd mail_folders
New directory is : /home/ballisti/mail_folders
bigbang:ballisti:[mail_folders]:95 % sa-learn --spam --mbox SPAM
Learned from 44 message(s) (49 message(s) examined).
bigbang:ballisti:[mail_folders]:96 % sa-learn --spam --mbox spams
Learned from 238 message(s) (250 message(s) examined).
Teach to recognise good mails:
bigbang:ballisti:[mail_folders]:97 % sa-learn --ham --mbox SYSTEM/betriebsinfo
Learned from 42 message(s) (42 message(s) examined).
bigbang:ballisti:[mail_folders]:98 % sa-learn --ham --mbox SYSTEM/erledigt
Learned from 449 message(s) (451 message(s) examined).
bigbang:ballisti:[mail_folders]:99 % sa-learn --ham --mbox SYSTEM/complaints
Learned from 59 message(s) (62 message(s) examined).
Use as many mailboxes as you like. Note that SpamAssassin will remember
what mails it's learnt from, so you can re-run this as often as you like.
As given by the instructions in the distribution package:
(do NOT do it like this, this is kept here for information only)
sa-learn --spam ~/Mail/saved-spam-folder
sa-learn --nonspam ~/Mail/inbox
sa-learn --nonspam ~/Mail/other-nonspam-folder
cat >.spamassasin.cf score JAVASCRIPT 1.0 ^D(this is just an example)
Where is what: Customising SpamAssassin
These are the configuration files installed by SpamAssassin.
Note that in our system we use a special method for packages
called SEPP. Thus the file position is quite different that the
one you find in the distribution documentations.
The commands that can be used therein are listed in the
POD documentation for the Mail::SpamAssassin::Conf class.
Run the following command to read it:
perldoc /usr/pack/spamassassin-2.60-ds/lib/perl/5.8.0/Mail/SpamAssassin/Conf.pm
.
Note: The following directories are
the standard defaults that people use. There is an explanation of all the
default locations that SpamAssassin will look at the end.
Note that the location in our (IFH) system is always under
/usr/pack/spamassassin-2.60-ds/
but the following description is more general and applies to
the distribution package:
Unless you're using spamd, there is no difference in interpretation between the rules file and the preferences file, so users can add new rules for their own use in the "~/.spamassassin/user_prefs" file, if they like. (spamd disables this for security and increased speed.)
| Distributed Configuration Files | IFH Configuration files |
|---|---|
|
'__def_rules_dir__' '__prefix__/share/spamassassin' '/usr/local/share/spamassassin' '/usr/share/spamassassin' |
/usr/pack/spamassassin-2.60-ds/share/spamassassin /usr/pack/spamassassin-2.60-ds/share/spamassassin /usr/pack/spamassassin-2.60-ds/etc/mail/spamassassin /usr/pack/spamassassin-2.60-ds/etc/mail/spamassassin |
| Site Configuration Files | IFH Configuration files |
|
'__local_rules_dir__' '__prefix__/etc/mail/spamassassin' '__prefix__/etc/spamassassin' '/usr/local/etc/spamassassin' '/usr/pkg/etc/spamassassin' '/usr/etc/spamassassin' '/etc/mail/spamassassin' '/etc/spamassassin' | |
| Default User Preferences File | IFH Default user Preferences |
|
'__local_rules_dir__/user_prefs.template' '__prefix__/etc/mail/spamassassin/user_prefs.template' '__prefix__/share/spamassassin/user_prefs.template' '/etc/spamassassin/user_prefs.template' '/etc/mail/spamassassin/user_prefs.template' '/usr/local/share/spamassassin/user_prefs.template' '/usr/share/spamassassin/user_prefs.template' |
After installation, try "perldoc Mail::SpamAssassin::Conf" to see what
can be set.
Common first-time tweaks include:
Statistics on how many false positives to expect at various
different thresholds are available in the "STATISTICS.txt" file in
the "rules" directory.
auto_whitelist_path /var/spool/spamassassin/auto-whitelist
auto_whitelist_file_mode 0666