You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2005/10/07 04:00:43 UTC

svn commit: r306973 - in /spamassassin/trunk: build/mkrules rules/25_body_tests_es.cf

Author: jm
Date: Thu Oct  6 19:00:39 2005
New Revision: 306973

URL: http://svn.apache.org/viewcvs?rev=306973&view=rev
Log:
update the compiler; fills in some of the TODOs on RulesProjPromotion

Modified:
    spamassassin/trunk/build/mkrules
    spamassassin/trunk/rules/25_body_tests_es.cf

Modified: spamassassin/trunk/build/mkrules
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/build/mkrules?rev=306973&r1=306972&r2=306973&view=diff
==============================================================================
--- spamassassin/trunk/build/mkrules (original)
+++ spamassassin/trunk/build/mkrules Thu Oct  6 19:00:39 2005
@@ -25,6 +25,7 @@
   die "mkrules/run [--src srcdir] [--out outputdir]\n";
 }
 
+use strict;
 use File::Find;
 use File::Copy;
 
@@ -37,51 +38,279 @@
 die "unreadable src" unless (-d $opt_src);
 die "unreadable out" unless (-d $opt_out);
 
+# source files that need compilation, and their targets
+my $needs_compile = { };
+
 File::Find::find ({
           wanted => \&wanted,
           no_chdir => 1
         }, $opt_src);
 
+# context for the rules compiler
+my $seen_rules = { };
+my $output_files = { };
+my $output_file_text = { };
+
+compile_sorted($needs_compile);
+write_output_files();
+
+exit;
+
 sub wanted {
-  return unless (-f $File::Find::name && /\d.*\.cf$/i);
+  return unless (-f $File::Find::name && /\d.*\.(?:cf|pm)$/i);
 
   my $dir = $File::Find::name;
   $dir =~ s/^${opt_src}[\/\\\:]//s;
   $dir =~ s/([^\/\\\:]+)$//;
-  my $file = $1;
+  my $filename = $1;
 
-  if ($dir =~ /sandbox/) {
-    apply_sandbox_rules($dir, $file);
-  }
-  else {
-    copy_rule_file_if_newer($dir, $file);
+  my $f = "$opt_src/$dir$filename";
+  my $t = "$opt_out/$filename";
+  $needs_compile->{$f} = {
+          f => $f,
+          t => $t,
+          dir => $dir,
+          filename => $filename
+        };
+}
+
+# compile all the source files found by the wanted() sub, in sorted
+# order so that the order of precedence makes sense.
+
+sub compile_sorted {
+  my ($sources) = @_;
+
+  foreach my $f (sort keys %$sources) {
+    my $entry = $needs_compile->{$f};
+    my $t = $entry->{t};
+
+    # TODO: dependency checking optimization?
+    ## my $needs_rebuild = 0;
+    ## if (!-f $t || -M $t > -M $f) {
+    ## # the source file is newer, or dest is not there
+    ## $needs_rebuild = 1;     
+    ## }
+
+    my $needs_rebuild = 1;
+
+    if ($entry->{dir} =~ /sandbox/) {
+      # sandbox rules
+      rule_file_compile(0, $f, $t, $entry->{filename});
+    }
+    elsif ($entry->{dir} =~ /extra/) {
+      # 'extra' rulesets; not built by default (TODO)
+      next;
+    }
+    else {
+      # rules in "core" and "lang" are always copied
+      if ($needs_rebuild) {
+        rule_file_compile(1, $f, $t, $entry->{filename});
+      }
+    }
   }
 }
 
+# implement the validation criteria from
+# http://wiki.apache.org/spamassassin/RulesProjPromotion .
+#
+# Rules are compiled from source dir to output dir. All rules in "core" are
+# always promoted (for backwards compatibility). In addition, rules in the
+# sandboxes will be promoted, if the rules source file contains a "publish
+# core" command prior to that rule.  This command is added (by hand!) to the
+# source file by committers, as the rules pass the validation criteria.
+#
+# The compiler will copy the rules to the output directory. By default, the
+# filename is preserved; so a rule in a file called "20_foo.cf" in the source
+# directory will be output to the file "20_foo.cf".
+#
+# ('pubfile' is another command to select the name of the output file in the
+# "rules" directory: pubfile NN_filename.cf , and override that behaviour.)
+#
+# Rules will be autorenamed, if there's a collision between a new rule name and
+# one that's already been output by the compiler in another source file. The
+# autorenaming is very simple -- portions of the current source path are
+# appended to the rule name, sanitised.
+#
+# TODO: linting during compilation, and ignore lint-failures? may have to
+# reimplement a small subset of lint behaviour to do this.
+
+sub rule_file_compile {
+  my ($copy_all, $f, $t, $filename) = @_;
+
+  open (IN, "<$f") or die "cannot read $f";
+
+  # a fast parser for the config file format; don't need the
+  # full deal here, and it must be fast, since it's run on every
+  # "make" invocation
+
+  my $rules = { };
+  my $rule_order = [ ];
+
+  # $COMMENTS is a "catch-all" "name", for lines that appear before the first
+  # line that refers to a rule by name.  Those lines are not published by
+  # themselves; they'll be published to all pubfiles found in the file.
+  #
+  # It's assumed they are comments, because they generally are, but could
+  # be all sorts of unparseable lines.
+
+  my $COMMENTS = '!comments!';
+  my $lastrule = $COMMENTS;
+
+  while (<IN>) {
+    my $orig = $_;
 
-sub copy_rule_file_if_newer {
-  my ($dir, $file) = @_;
+    s/^#reuse/reuse/;   # dirty hack.  we need to fix this to just be
+    # a keyword which the engine ignores, this is absurd!  TODO
+
+    s/#.*$//g; s/^\s+//; s/\s+$//;
+
+    # send comments/blank lines to the current default output
+    if (/^$/) {
+      $rules->{$lastrule}->{text} .= $orig;
+      next;
+    }
+
+    # save "lang" declarations
+    my $lang = '';
+    if (s/^lang\s+(\S+)\s+//) {
+      $lang = $1;
+    }
+
+    if (/^
+        (header|rawbody|body|full|uri|meta|mimeheader|describe|
+         tflags|reuse|score)
+        \s+(\S+)\s+(.*)$
+      /x)
+    {
+      my $type = $1;
+      my $name = $2;
+      my $val = $3;
+
+      my $origname = $name;
+      $name = rule_name_avoid_collisions($name, $f);
+
+      if (!$rules->{$name}) { $rules->{$name} = rule_entry_create(); }
+      $rules->{$name}->{origname} = $origname;
+      $rules->{$name}->{text} .= $orig;
+
+      $lastrule = $name;
+      push (@$rule_order, $name);
+    }
+    elsif (/^
+        (pubfile|publish)
+        \s+(\S+)\s*(.*?)$
+      /x)
+    {
+      my $command = $1;
+      my $name = $2;
+      my $val = $3;
+
+      my $origname = $name;
+      $name = rule_name_avoid_collisions($name, $f);
+
+      if (!$rules->{$name}) { $rules->{$name} = rule_entry_create(); }
+      $rules->{$name}->{origname} = $origname;
+
+      if ($command eq 'publish') {
+        # the 'publish' command defaults to "1", unless it explicitly
+        # is set to "0".
+        if (!defined $val) { $val = '1'; }
+      }
+      $rules->{$name}->{$command} = $val;
+    }
+    else {
+      # warn "unknown line in rules file '$f', saving to default: $orig";
+      $rules->{$lastrule}->{text} .= $orig;
+    }
+  }
+  close IN;
+
+  # now append all the found text to the output file buffers
+  my %already_done = ();
+  foreach my $name (@$rule_order)
+  {
+    # only do each rule once, please ;)
+    next if exists $already_done{$name};
+    $already_done{$name} = undef;
+
+    my $pubfile = $rules->{$name}->{pubfile};
+    $pubfile ||= $filename;
+    $pubfile = $opt_out.'/'.$filename;
+    $output_files->{$pubfile} = 1;
+
+    if (!$copy_all && !$rules->{$name}->{publish}) {
+      # don't output non-published rules
+      next;     
+    }
+
+    my $text = $rules->{$name}->{text};
+    if (!$text) {
+      next;     # nothing to write!
+    }
+
+    if (!$output_file_text->{$pubfile}) {
+      $output_file_text->{$pubfile} = output_file_header($f);
+
+      # do we have any top-of-file comments?  if so, add it
+      my $cmts = $rules->{$COMMENTS}->{text}; $cmts ||= '';
+      $output_file_text->{$pubfile} .= $cmts;
+    }
+
+    $output_file_text->{$pubfile} .= $text;
+  }
 
-  my $f = "$opt_src/$dir/$file";
-  my $t = "$opt_out/$file";
+  print "$f: ".(scalar @$rule_order)." rules copied\n";
 
-  if (!-r $t || -M $t > -M $f) {
-    print "cp $f $t\n";
-    copy($f, $t) or die "copy failed from $f to $t: $!\n";
+  # ok; file complete.  now mark all those rules as "seen"; future
+  # refs to those rule names will trigger an autorename.
+  foreach my $name (@$rule_order) {
+    $seen_rules->{$name} = 1;
   }
 }
 
-sub apply_sandbox_rules {
-  my ($dir, $file) = @_;
+sub write_output_files {
+  foreach my $pubfile (sort keys %$output_files) {
+    if (-f $pubfile) {
+      unlink $pubfile or die "cannot remove output file '$pubfile'";
+    }
+
+    if ($output_file_text->{$pubfile}) {
+      open (OUT, ">".$pubfile) or die "cannot write to output file '$pubfile'";
+      print OUT $output_file_text->{$pubfile};
+      close OUT or die "cannot close output file '$pubfile'";
+      print "$pubfile: written\n";
+    }
+    else {
+      print "$pubfile: no rules promoted\n";
+    }
+  }
+}
 
-  # TODO! this section should implement the validation criteria from
-  # http://wiki.apache.org/spamassassin/RulesProjPromotion .
-  #
-  # right now, it just copies the file, raw.
+sub rule_entry_create {
+  return {
+    text => '',
+    publish => 0
+  };
+}
+
+sub rule_name_avoid_collisions {
+  my ($rule, $path) = @_;
+  if (!exists $seen_rules->{$rule}) {
+    return $rule;
+  }
+  else {
+    my $new = $path;
+    $new =~ s/[^A-Za-z0-9]+/_/gs;
+    $new =~ s/_+/_/gs;
+    $new =~ s/^_//;
+    $new =~ s/_$//;
+    return $rule.'_'.$new;
+  }
+}
 
-  my $f = "$opt_src/$dir/$file";
-  my $t = "$opt_out/$file";
-  print "grepcp?? $f $t\n";
-  copy($f, $t) or die "copy failed from $f to $t: $!\n";
+sub output_file_header {
+  my ($filename) = @_;
+  my $now = scalar localtime time;
+  return "# [compiled from '$filename' on $now]\n";
 }
 

Modified: spamassassin/trunk/rules/25_body_tests_es.cf
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/rules/25_body_tests_es.cf?rev=306973&r1=306972&r2=306973&view=diff
==============================================================================
--- spamassassin/trunk/rules/25_body_tests_es.cf (original)
+++ spamassassin/trunk/rules/25_body_tests_es.cf Thu Oct  6 19:00:39 2005
@@ -1,6 +1,5 @@
-# SpamAssassin rules file: Spanish body tests
-#
-# Maintainer: Jesus Climent <jesus dot climent at hispalinux dot es>
+# [compiled from 'rulesrc/lang/es/25_body_tests_es.cf' on Thu Oct  6 18:55:11 2005]
+# SpamAssassin rules file: default SPF whitelists
 #
 # Please don't modify this file as your changes will be overwritten with
 # the next update. Use @@LOCAL_RULES_DIR@@/local.cf instead.
@@ -8,152 +7,83 @@
 #
 # <@LICENSE>
 # Copyright 2004 Apache Software Foundation
-#
+# 
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
-#
+# 
 #     http://www.apache.org/licenses/LICENSE-2.0
-#
+# 
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # </...@LICENSE>
-#
-###########################################################################
-#
-# Leaving some of these without "lang es" because they show up in English
-# language inboxes.
-#
-###########################################################################
-
-lang es body REMOVE_ES_01		/(?:Para (?:no|dejar de)|[sS]i (?:U(?:ste)?d\. )?no (?:deseas?|qui?er[ée]s)) (?:seguir )?reci[vb]i(?:r|endo) (?:en el futuro |m.s )?(?:ninguna otra|nuestr[ao]s?|est[ao]s?)?\s?(?:correos?|mensajes?|publicidad|informaci.n|ofertas?|(?:promoci.n|bolet.n)(?:es)?|(?:e-?)?mails? promocional(?:es)?|avisos|las comunicaciones)/i
-lang es describe REMOVE_ES_01		Claims you can be removed in Spanish
-
-lang es body REMOVE_ES_02		/(?:Para ser (?:elimina|removi)do|Si quieres? salir|Para eliminarse) del? (?:nuestra|esta|mailing) ?lista?,? (?:sera removido|responda el mail|solo tienes? que marcar|enviar un ?e-?mail)/i
-lang es describe REMOVE_ES_02		Claims you can be removed in Spanish
-
-lang es body REMOVE_ES_03		/(?:Si|o)(?: U(?:ste)?d\.?)? deseas? (?:que le (?:borre|remova|elimine)mos|ser (?:borra|removi|elimina)do|recalcar tus ganas de eliminarte) (?:por favor |de (?:cualquier listado futuro,?|(?:la|nuestra|esta) (?:lista(?: de (?:(?:e-?)?mail|correo))?|base de datos)),? )?(?:s.lo )?(?:por favor|responda|env.(?:ar?|e(?:nos)?).? (?:(?:simplemente|un) )?(?:e-?)?mail|haga|solicit[ae]|envi[ae])/i
-lang es describe REMOVE_ES_03		Claims you can be removed in Spanish
-
-lang es body REMOVE_ES_04		/(?:si desea|para) no recibir mas (?:nuestras promocione|mensaje)s/i
-lang es describe REMOVE_ES_04		Claims you can be removed in Spanish
-
-lang es body REMOVE_ES_05		/un email.{1,10}y procedo a eliminarle de mi base de datos/i
-lang es describe REMOVE_ES_05		If you send an email you will be OptOut
-
-lang es body REMOVE_ES_06		/Si no desea ser incluido en futuros env.os/i
-lang es describe REMOVE_ES_06		Claims you can opt-out
-
-lang es body REMOVE_ES_07		/Si (?:este mensaje|esta publicidad) no es de su inter.s,? (?:(?:te|le) pedimos disculpas|por favor env.e un (?:e-?)?mail)/i
-lang es describe REMOVE_ES_07		Claims you can opt-out
-
-lang es body REMOVE_ES_08		/(?:Para|Si desea) (?:removerse|borrarse),? (?:debe hacerlo en|solo env.e un (?:mail|\"remove\"))/
-lang es describe REMOVE_ES_08		Claims you can opt-out
-
-lang es body SUBSCRIBE_ES_01		/Si usted desea Agregarse a nuestra base de datos/i
-lang es describe SUBSCRIBE_ES_01	If you want to subscribe...
-
-lang es body EXCUSE_ES_01		/est(?:o|e (?:correo|mensaje|(?:e-?)mail)|a carta) no (?:es|(?:puede se.|se(?: puede)?) considera(?:d[oa]|r)?) .?S[Pp][Aa][Mm].?,?(?:\(correo no deseado\))? (?:(?:puesto|ya) que|mientras|si)/i
-lang es describe EXCUSE_ES_01		Claims not to be spam in Spanish
-
-lang es body EXCUSE_ES_02		/Me he tomado la libertad de enviarle este mail por/i
-lang es describe EXCUSE_ES_02		Someone fell free to send you a message in Spanish
-
-lang es body EXCUSE_ES_03		/Este (?:es un )?(?:mensaje|(?:e-?)?mail|correo) (?:llega a usted gracias a|ha sido enviado por solicitud de|no solicitado enviado a petici.n de)/i
-lang es describe EXCUSE_ES_03		Someone requested an spammer to spam you in Spanish
-
-lang es body EXCUSE_ES_05		/Enviamos este mail por considerar la difusi[óo]n (?:a trav[ée]s de|del) correo electr[óo]nico una alternativa econ[óo]mica/i
-lang es describe EXCUSE_ES_05		El correo como alternativa comercial
-
-lang es body EXCUSE_ES_06		/Si ha recibido este mensaje por error/i
-lang es describe EXCUSE_ES_06		Mensaje enviado por error
-
-lang es body EXCUSE_ES_07		/ning.n mensaje publicitario por mail puede ser considerado spam si/i
-lang es describe EXCUSE_ES_07		No se puede considerar spam
-
-lang es body DEJAR_DE_FUMAR_ES		/(?:pastillas|dispositivo|terapia) para dejar de fumar/i
-lang es describe DEJAR_DE_FUMAR_ES	Para dejar de fumar
 
-## This ones most likelly will appear only in spanish mails
-#
-lang es body GRATIS_ES			/(?:llame|totalmente|TOTALMENTE|ABSOLUTAMENTE|ES).{1,14}GRAT(?:UITO|IS)/
-lang es describe GRATIS_ES		NOS CHILLAN PARA DECIR QUE ES GRATIS
-lang es score GRATIS_ES	1.4
-
-lang es body INTERESADO_ES		/Si (?:Ud\.? )?(?:considera [uú]til|le interesa) (?:(?:nuestro|contratar el) servicio|el tema),? (?:haga .{1,5}click|(?:debe enviarnos un|contesteme (?:solamente )?a este) (?:e-?)?mail|l[oe] invitamos a SUBSCRIBIRSE)/i
-lang es describe INTERESADO_ES		Nos animan a contestar si estamos interesados
-
-## Recursos generales de spammers
-#
-lang es body LEY_ORGANICA_ES		/(?:cumpl(?:e|imos)|nos adherimos a|En cumplimiento de lo dispuesto en) la Ley Org.nica 15\/1999 de 13 de Diciembre/i
-lang es describe LEY_ORGANICA_ES	Dice cumplir con la ley
-lang es score LEY_ORGANICA_ES		2.0
-
-lang es body NORMATIVA_SPAM_ES		/(?:Bajo el Decreto .{2,3}S\.1618 titulo (?:III|3ro\.).{2,3} aprobado por el 105 congreso|105 congreso base de las normativas internacionales sobre SPAM)/i
-lang es describe NORMATIVA_SPAM_ES	Clama cumplir con la normativa SPAM
-lang es score NORMATIVA_SPAM_ES	2.0
-
-lang es body LEY_CHILE_ES_01		/la legislaci.n chilena no contempla el env.o de publicidad por correo electr.nico/i
-lang es describe LEY_CHILE_ES_01	No existe legislación en Chile contra el SPAM
-
-lang es body LEY_CHILE_ES_02		/Este mensaje se env.a bajo la ley 19.628 de la Costituci.n de la Rep.blica de Chile/i
-lang es describe LEY_CHILE_ES_02	Clama cumplir con la legislación chilena
-
-lang es body TARJETA_VERDE_ES		/Consiga un permiso de residencia.{0,30}Tarjeta Verde/i
-lang es describe TARJETA_VERDE_ES	Inmigración legal (?) a los Estados Unidos
-
-lang es body PROMOCION_ES		/precio promocional|promoci.n especial|esta promoci.n/i
-lang es describe PROMOCION_ES		Promocion especial.
-
-lang es body ALTA_BUSCADORES_ES		/alta en (?:mas de )?\d{2,4} buscadores hispanos/i
-lang es describe ALTA_BUSCADORES_ES	Alta en buscadores hispanos.
-
-lang es body EXCLAMACION_ES		/INF[OÓ]RMESE|(?:CONTACT|VISIT|RESPOND|ENVI|PID|COMPR|SOLICIT|CONSULT|ESCRIB|LLAM)[AE](?:NOS)?|PROMOCI[OÓ]N(?:ES)?|OFERTAS?|SIN COMPROMISO/
-lang es describe EXCLAMACION_ES		IMPERATIVOS/EXCLAMACIONES EN MAYUSCULAS.
-
-lang es body PRESENTAMOS_ES		/[tl]e (?:ofrece|presenta|informa(?:re)?)mos/i
-lang es describe PRESENTAMOS_ES		Presentación de un nuevo producto.
-
-lang es body CONTRA_REEMBOLSO_ES	/(?:envios|pago) contra[r -]?reembolso/i
-lang es describe CONTRA_REEMBOLSO_ES	Pago contra reembolso.
-
-lang es body PEDIDO_ES			/haga su pedido/i
-lang es describe PEDIDO_ES		Para hacer su pedido.
-
-lang es body CLICK_ES			/(?:ha(?:ga|z|ciendo|cer) click?|oprim[ae]) (?:aqu.|en el bot.n)/i
-lang es describe CLICK_ES		Haga click aqui.
-
-lang es body REGALO_ES			/[lt]e (?:regal|obsequi)amos|ll.vate tu regalo|para (?:ganar uno de nuestros|recibir este) premios?/i
-lang es describe REGALO_ES		Los regalos no existen, salvo de nuestros amigos.
-
-lang es body GANADORES_ES_01		/Usted y su familia podr.an tener suerte y ser los ganadores/i
-lang es describe GANADORES_ES_01	Pueden ser ganadores.
-
-lang es body GANADORES_ES_02		/su (?:e-?)?mail ha (?:sido elegi|resulta)do ganador/
-lang es describe GANADORES_ES_02	Ha sido ganador.
-
-lang es body PORNO_GRATIS_ES		/porno .{3,5} gratis/i
-lang es describe PORNO_GRATIS_ES	Porno gratis.
-
-lang es body MAS_INFORMACION_ES		/(?:si qu?ier[ée]s|para|por) (?:solo )?(?:solicitar )?(?:m.s|mayor) informaci.n/i
-lang es describe MAS_INFORMACION_ES	Mas informacion.
-
-lang es body INFORMACION_RESERVA_ES	/Informaci.n y reserva/i
-lang es describe INFORMACION_RESERVA_ES	Informacion y reserva
-
-lang es body REENVIA_ES			/Ayuda a difundir esta informaci.n|te pedimos que les reenv.es este mensaje/
-lang es describe REENVIA_ES		Conviertete en Spammer.
+###########################################################################
+# SPF whitelist rules
 
-lang es body NO_MAS_MAIL_1_ES		/NO VOLVEREMOS A ENVIARLE MAS E?-?MAIL|no volver[aá] a recibir ningún otro email de nosotros/
-lang es describe NO_MAS_MAIL_1_ES	No nos envían más spam... seguro que no.
+ifplugin Mail::SpamAssassin::Plugin::SPF
 
-lang es body NO_MAS_MAIL_2_ES		/(?:Este (?:mail|mensaje) se env[ií]a una|Usted recibir[áa] este mensaje por) [úu]nica vez/
-lang es describe NO_MAS_MAIL_2_ES	No recibirá este spam otra vez... seguro que no.
+header USER_IN_SPF_WHITELIST	eval:check_for_spf_whitelist_from()
+describe USER_IN_SPF_WHITELIST	From: address is in the user's SPF whitelist
+tflags USER_IN_SPF_WHITELIST	userconf nice noautolearn net
+
+header USER_IN_DEF_SPF_WL	eval:check_for_def_spf_whitelist_from()
+describe USER_IN_DEF_SPF_WL	From: address is in the default SPF white-list
+tflags USER_IN_DEF_SPF_WL	userconf nice noautolearn net
+
+header __ENV_AND_HDR_FROM_MATCH	eval:check_for_matching_env_and_hdr_from()
+meta ENV_AND_HDR_SPF_MATCH	(USER_IN_DEF_SPF_WL && __ENV_AND_HDR_FROM_MATCH)
+describe ENV_AND_HDR_SPF_MATCH	Env and Hdr From used in default SPF WL Match
+tflags ENV_AND_HDR_SPF_MATCH	userconf nice noautolearn net
 
-lang es body COLECTOR_DE_MAILS_ES	/Las direcciones electronicas han sido tomadas de lugares publicos/
-lang es describe COLECTOR_DE_MAILS_ES	Las direcciones fueron obtenidas de internet.
-# vim: set ai! tw=1000:
+###########################################################################
+# Default whitelists.  These should be addresses which send mail that is often
+# tagged (incorrectly) as spam; it also helps that they be addresses of big
+# companies with lots of lawyers, so if spammers impersonate them, they'll get
+# into big trouble, so it doesn't provide a shortcut around SpamAssassin.
+#
+# Whitelist and blacklist addresses are now file-glob-style patterns, so
+# "friend@somewhere.com", "*@isp.com", or "*.domain.net" will all work.
+#
+# Please do not add unmoderated public mailing lists here.  They are
+# too easily abused by spammers.
+
+def_whitelist_from_spf   *@nytimes.com
+def_whitelist_from_spf   *@amazon.com
+def_whitelist_from_spf   *@*.amazon.com
+def_whitelist_from_spf   *@amazon.co.uk
+def_whitelist_from_spf   *@*.amazon.co.uk
+def_whitelist_from_spf   *@ora.com
+def_whitelist_from_spf   *@*.ora.com
+def_whitelist_from_spf   *@bn.com
+def_whitelist_from_spf   *@mypoints.com
+def_whitelist_from_spf   *@*.mypoints.com
+def_whitelist_from_spf   *@paypal.com
+def_whitelist_from_spf   *@ebay.com
+def_whitelist_from_spf   *@foolsubs.com
+def_whitelist_from_spf   *@match.com
+def_whitelist_from_spf   *@walmart.com
+
+# bugtraq: can contain malicious Javascript etc.
+def_whitelist_from_spf   *@securityfocus.com
+
+def_whitelist_from_spf   *@mediaunspun.imakenews.net
+
+# sender of Cringley newsletter
+def_whitelist_from_spf   *@bdcimail.com
+
+# Silicon.com newslettters - we see thousands of these
+def_whitelist_from_spf   *@silicon.com
+
+# C|Net news.com newsletters
+def_whitelist_from_spf   *@newsletter.online.com
+
+# bug 1348
+def_whitelist_from_spf   *@enews.buy.com
+def_whitelist_from_spf   *@palm.m0.net
+def_whitelist_from_spf   *@handspring.4at1.com
 
+endif # Mail::SpamAssassin::Plugin::SPF