SpamAssassin: Difference between revisions

From DWIKI
No edit summary
 
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Links==
*[http://spamassassin.org/ Homepage]
*[[Amavis and SpamAssassin]]
*[https://wiki.apache.org/spamassassin/WritingRules Writing Rules]
*[[SpamAssassin and MimeDefang]]
*[http://www.hart.co.jp/spam/sa-clamav-e.html Setting Up SpamAssassin and ClamAV with Sendmail on FreeBSD]
*http://ist.uwaterloo.ca/~dkeenan/talks/spamassassin/config.html
*http://khopesh.com/Anti-spam#iXhash
*http://spamassassin.apache.org/full/3.3.x/doc/Mail_SpamAssassin_Conf.html
===spamass-milter===
*http://wiki.sund.org/?title=Postfix_and_milters
==Notes==
3.2.2 is BROKEN,
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5574 isn't entirely correct, but the idea is:
POSIX::setuid($uuid);  # set effective and real UID
==Site==
*[http://spamassassin.apache.org/ Homepage]
*[http://spamassassin.apache.org/ Homepage]
*[http://wiki.apache.org/spamassassin/ SA Wiki]
*[http://wiki.apache.org/spamassassin/ SA Wiki]
*[http://www.yrex.com/spam/spamconfig.php Configuration generator]
*[http://www.yrex.com/spam/spamconfig.php Configuration generator]
*[http://users.own-hero.net/~decoder/fuzzyocr/ fuzzyocr plugin] to catch image spam, ths instructions need work: it should be installed where the reset of plugins go,  
*[http://users.own-hero.net/~decoder/fuzzyocr/ fuzzyocr plugin] to catch image spam, these instructions need work: it should be installed where the rest of the plugins go, in /usr/lib/perl5/site_perl/5.8.4/Mail/SpamAssassin/ or so.
/usr/lib/perl5/site_perl/5.8.4/Mail/SpamAssassin/ or so.
*[http://www.rulesemporium.com/ SpamAssassin Rules Emporium (SARE)]
*[http://www.rulesemporium.com/ SpamAssassin Rules Emporium (SARE)]
*http://khopesh.com/wiki/Anti-spam#Other_SpamAssassin_tools
==Tuning==
===se2c===
Compiled rulesets.
*http://spamassassin.apache.org/full/3.2.x/doc/sa-compile.html
==Related software==
*[http://freshmeat.net/projects/sa-stats/ sa-stats]
==Useful commands==
*sa-update -D
*sa-compile (to be run after sa-update!)
*spamassassin -D --lint
*/usr/local/share/spamassassin/tools/check_whitelist
==SpamAssassin and userprefs on MySQL==
Useful when using shared bayesdb and squirrelmail sasql. Read /usr/share/doc/spamassassin/sql.
mysql -u root -p
mysql>grant insert,select,delete,update on sasql.* to 'sasqluser'@'localhost' identified by 'sasqlpass';
mysql>flush privileges;
mysql>create database sasql;
mysql>quit
mysql sasql -u root -p < /usr/share/doc/spamassassin/sql/userpref_mysql.sql
and make sure to run spamd with the options '''-q -x'''.
On debian you set those in '''/etc/default/spamassassin''' under "OPTIONS".
==FAQ==
===default scores===
/var/lib/spamassassin/3.004000/updates_spamassassin_org/50_scores.cf
=== dns: sendto() failed: Connection refused ===
check if first nameserver in /etc/resolv.conf actually works. if you changed your nameserver configuration, restart spamassassin.
===what do those rule names mean?===
http://spamassassin.apache.org/tests_3_0_x.html
===testing spamassassin===
spamd -D
===netset: illegal network address given===
with some luck this means you have to check your "trusted_networks" line in local.cf
===The output of things like _REPORT_ and _TESTS_===
hardcoded in PerMsgStatus.pm
===bayes: cannot open bayes databases /var/spool/MIMEDefang/.spamassassin/bayes_* R/W: lock failed: File exists===
MIGHT mean there's stale lockfiles /var/spool/MIMEDefang/.spamassassin/bayes.lock.*
stop whatever is running, remove them and try again
===config: failed to parse, now a plugin, skipping: ok_languages===
v310.pre:
loadplugin    Mail::SpamAssassin::Plugin::TextCat
===spamass-milter[61354]: Could not retrieve sendmail macro "r"!.===
Please add it to confMILTER_MACROS_ENVRCPT for better spamassassin results
===Configuration===
http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Conf.html
===spamd: unauthorized connection from xxx===
that's the -A option
===prefork: sysread(8) not ready, wait max 300 secs===
A Bug
===Can't locate Mail/SpamAssassin/CompiledRegexps/body_0.pm in @INC===
Try running sa-compile and complain to author.
===bayes: cannot open bayes databases /var/mail/bayes/.spamassassin/bayes_* R/W: tie failed: Inappropriate ioctl for device===
Means your BDB files are of/from wrong version
===http: request failed: 500 Can't connect to spamassassin.kluge.net:80 (Bad hostname 'spamassassin.kluge.net'):===
probably freebsd? check /var/db/spamassassin/*/updates_spamassassin_org/MIRRORED.BY
===sa-compile: not compiling; 'spamassassin --lint' check failed!===
Perlish for "ERROR: some error"

Latest revision as of 10:43, 25 January 2018

Links

spamass-milter

Notes

3.2.2 is BROKEN, http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5574 isn't entirely correct, but the idea is:

POSIX::setuid($uuid);  # set effective and real UID

Site

Tuning

se2c

Compiled rulesets.

Related software

Useful commands

  • sa-update -D
  • sa-compile (to be run after sa-update!)
  • spamassassin -D --lint
  • /usr/local/share/spamassassin/tools/check_whitelist

SpamAssassin and userprefs on MySQL

Useful when using shared bayesdb and squirrelmail sasql. Read /usr/share/doc/spamassassin/sql.

mysql -u root -p
mysql>grant insert,select,delete,update on sasql.* to 'sasqluser'@'localhost' identified by 'sasqlpass';
mysql>flush privileges;
mysql>create database sasql;
mysql>quit
mysql sasql -u root -p < /usr/share/doc/spamassassin/sql/userpref_mysql.sql

and make sure to run spamd with the options -q -x.

On debian you set those in /etc/default/spamassassin under "OPTIONS".


FAQ

default scores

/var/lib/spamassassin/3.004000/updates_spamassassin_org/50_scores.cf

dns: sendto() failed: Connection refused

check if first nameserver in /etc/resolv.conf actually works. if you changed your nameserver configuration, restart spamassassin.

what do those rule names mean?

http://spamassassin.apache.org/tests_3_0_x.html

testing spamassassin

spamd -D 

netset: illegal network address given

with some luck this means you have to check your "trusted_networks" line in local.cf

The output of things like _REPORT_ and _TESTS_

hardcoded in PerMsgStatus.pm


bayes: cannot open bayes databases /var/spool/MIMEDefang/.spamassassin/bayes_* R/W: lock failed: File exists

MIGHT mean there's stale lockfiles /var/spool/MIMEDefang/.spamassassin/bayes.lock.* stop whatever is running, remove them and try again


config: failed to parse, now a plugin, skipping: ok_languages

v310.pre:

loadplugin     Mail::SpamAssassin::Plugin::TextCat

spamass-milter[61354]: Could not retrieve sendmail macro "r"!.

Please add it to confMILTER_MACROS_ENVRCPT for better spamassassin results

Configuration

http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Conf.html


spamd: unauthorized connection from xxx

that's the -A option


prefork: sysread(8) not ready, wait max 300 secs

A Bug

Can't locate Mail/SpamAssassin/CompiledRegexps/body_0.pm in @INC

Try running sa-compile and complain to author.

bayes: cannot open bayes databases /var/mail/bayes/.spamassassin/bayes_* R/W: tie failed: Inappropriate ioctl for device

Means your BDB files are of/from wrong version


http: request failed: 500 Can't connect to spamassassin.kluge.net:80 (Bad hostname 'spamassassin.kluge.net'):

probably freebsd? check /var/db/spamassassin/*/updates_spamassassin_org/MIRRORED.BY


sa-compile: not compiling; 'spamassassin --lint' check failed!

Perlish for "ERROR: some error"