diff -r -c /export/src/Mail-SpamAssassin-3.0.1/lib/Mail/SpamAssassin/EvalTests.pm ./lib/Mail/SpamAssassin/EvalTests.pm *** /export/src/Mail-SpamAssassin-3.0.1/lib/Mail/SpamAssassin/EvalTests.pm 2004-10-22 18:38:59.000000000 -0700 --- ./lib/Mail/SpamAssassin/EvalTests.pm 2004-11-30 11:55:23.417020504 -0800 *************** *** 1351,1360 **** check_rbl_sub(@_); } ! # check a RBL if a message is Habeas SWE sub check_rbl_swe { my ($self, $rule, $set, $rbl_server, $subtest) = @_; if (!defined $self->{habeas_swe}) { $self->message_is_habeas_swe(); } --- 1351,1370 ---- check_rbl_sub(@_); } ! # Check a RBL if a message is Habeas SWE. ! # Test is skipped if the SWE 2.0 "Reputation Tag" is matched in the ! # Envelope From address. Otherwise transitional senders would get a ! # double bonus. ! # sub check_rbl_swe { my ($self, $rule, $set, $rbl_server, $subtest) = @_; + if (!defined $self->{envelope_accreditor_tag}) { + $self->message_envelope_accreditor_tag(); + } + if ($self->{envelope_accreditor_tag}) { + return 0; + } if (!defined $self->{habeas_swe}) { $self->message_is_habeas_swe(); } *************** *** 1364,1369 **** --- 1374,1395 ---- return 0; } + # check an RBL if "--accreditor" tag is in Envelope From. + # + # + sub check_rbl_accreditor { + my ($self, $rule, $set, $rbl_server, $subtest, $accreditor) = @_; + + if (!defined $self->{envelope_accreditor_tag}) { + $self->message_envelope_accreditor_tag(); + } + if ($self->{envelope_accreditor_tag} eq $accreditor) { + $self->check_rbl_backend($rule, $set, $rbl_server, 'A', $subtest); + } + return 0; + } + + # this only checks the address host name and not the domain name because # using the domain name had much worse results for dsn.rfc-ignorant.org sub check_rbl_from_host { *************** *** 2118,2123 **** --- 2144,2159 ---- return $self->{habeas_swe}; } + sub message_envelope_accreditor_tag { + my ($self) = @_; + + if ($self->get('EnvelopeFrom:addr') =~ /[@.]a--([a-z0-9]{3,})\./i) { + ($self->{envelope_accreditor_tag} = $1) =~ tr/A-Z/a-z/; + return; + } + $self->{envelope_accreditor_tag} = ""; + } + ########################################################################### # BODY TESTS: ########################################################################### diff -r -c /export/src/Mail-SpamAssassin-3.0.1/rules/20_dnsbl_tests.cf ./rules/20_dnsbl_tests.cf *** /export/src/Mail-SpamAssassin-3.0.1/rules/20_dnsbl_tests.cf 2004-10-22 18:39:05.000000000 -0700 --- ./rules/20_dnsbl_tests.cf 2004-11-30 11:58:09.526767984 -0800 *************** *** 171,176 **** --- 171,196 ---- tflags DNS_FROM_RFC_BOGUSMX net # --------------------------------------------------------------------------- + # Habeas Accredited Senders + # Last octet of the returned A record indicates the Habeas-assigned + # "Accreditation Level" of the Sender. + # 10 to 39 Personal, transactional, and Confirmed Opt In + # 40 to 59 Secure referrals and Single Opt In + # 60 to 99 Checked but not accredited by Habeas. + # + # sa-accredit.habeas.com is for SpamAssassin use. + # + header HABEAS_ACCREDITED_COI eval:check_rbl_accreditor('accredit-firsttrusted', 'sa-accredit.habeas.com.', '127\.\d+\.\d+\.[123]\d', 'habeas') + describe HABEAS_ACCREDITED_COI Habeas Accredited Confirmed Opt-In or Better + tflags HABEAS_ACCREDITED_COI net nice + header HABEAS_ACCREDITED_SOI eval:check_rbl_accreditor('accredit-firsttrusted', 'sa-accredit.habeas.com.', '127\.\d+\.\d+\.[45]\d', 'habeas') + describe HABEAS_ACCREDITED_SOI Habeas Accredited Opt-In or Better + tflags HABEAS_ACCREDITED_SOI net nice + header HABEAS_CHECKED eval:check_rbl_accreditor('accredit-firsttrusted', 'sa-accredit.habeas.com.', '127\.\d+\.\d+\.[6789]\d', 'habeas') + describe HABEAS_CHECKED Habeas Checked + tflags HABEAS_CHECKED net nice + + # --------------------------------------------------------------------------- # Now, single zone BLs follow: # DSBL catches open relays, badly-installed CGI scripts and open SOCKS and *************** *** 192,206 **** describe DNS_FROM_AHBL_RHSBL From: sender listed in dnsbl.ahbl.org tflags DNS_FROM_AHBL_RHSBL net # sa-hil.habeas.com for SpamAssassin queries # hil.habeas.com for other queries header HABEAS_INFRINGER eval:check_rbl_swe('hil', 'sa-hil.habeas.com.') describe HABEAS_INFRINGER Has Habeas warrant mark and on Infringer List tflags HABEAS_INFRINGER net # sa-hul.habeas.com for SpamAssassin queries # hul.habeas.com for other queries ! header HABEAS_USER eval:check_rbl_swe('hul', 'sa-hul.habeas.com.') describe HABEAS_USER Has Habeas warrant mark and on User List tflags HABEAS_USER net nice --- 212,229 ---- describe DNS_FROM_AHBL_RHSBL From: sender listed in dnsbl.ahbl.org tflags DNS_FROM_AHBL_RHSBL net + # Habeas Legacy support: the Habeas Infringers blocklist. # sa-hil.habeas.com for SpamAssassin queries # hil.habeas.com for other queries header HABEAS_INFRINGER eval:check_rbl_swe('hil', 'sa-hil.habeas.com.') describe HABEAS_INFRINGER Has Habeas warrant mark and on Infringer List tflags HABEAS_INFRINGER net + # Habeas Legacy support: the Habeas Users whitelist. This list contains users + # from accredit.habeas.com at "accreditation level" 10 to 39. # sa-hul.habeas.com for SpamAssassin queries # hul.habeas.com for other queries ! header HABEAS_USER eval:check_rbl_swe('hul-firsttrusted', 'sa-hul.habeas.com.') describe HABEAS_USER Has Habeas warrant mark and on User List tflags HABEAS_USER net nice diff -r -c /export/src/Mail-SpamAssassin-3.0.1/rules/50_scores.cf ./rules/50_scores.cf *** /export/src/Mail-SpamAssassin-3.0.1/rules/50_scores.cf 2004-10-22 18:39:05.000000000 -0700 --- ./rules/50_scores.cf 2004-11-27 15:01:24.000000000 -0800 *************** *** 657,662 **** --- 657,665 ---- score RCVD_IN_BSP_TRUSTED 0 -4.3 0 -4.3 # Habeas: http://www.habeas.com/ + score HABEAS_ACCREDITED_COI 0 -8.0 0 -8.0 + score HABEAS_ACCREDITED_SOI 0 -4.0 0 -4.0 + score HABEAS_CHECKED 0 -0.2 0 -0.2 score HABEAS_INFRINGER 0 16.0 0 16.0 score HABEAS_USER 0 -8.0 0 -8.0