You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2004/11/03 12:34:00 UTC

svn commit: rev 56482 - spamassassin/trunk/lib/Mail/SpamAssassin

Author: felicity
Date: Wed Nov  3 03:33:59 2004
New Revision: 56482

Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm
Log:
pass the message format into ArchiveIterator's wanted routine

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm	(original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm	Wed Nov  3 03:33:59 2004
@@ -152,10 +152,11 @@
 
 =item wanted_sub
 
-Reference to a subroutine which will process message data.  Usually set
-via set_functions().  The routine will be passed 4 values: class (scalar),
-filename (scalar), received date (scalar), and message content (array
-reference, one message line per element).
+Reference to a subroutine which will process message data.  Usually
+set via set_functions().  The routine will be passed 5 values: class
+(scalar), filename (scalar), received date (scalar), message content
+(array reference, one message line per element), and the message format
+key ('f' for file, 'm' for mbox, 'b' for mbx).
 
 =item result_sub
 
@@ -417,13 +418,13 @@
 
   my ($date, $class, $format, $mail) = run_index_unpack($msg);
 
-  if ($format eq "f") {
+  if ($format eq 'f') {
     return $self->run_file($class, $format, $mail, $date);
   }
-  elsif ($format eq "m") {
+  elsif ($format eq 'm') {
     return $self->run_mailbox($class, $format, $mail, $date);
   }
-  elsif ($format eq "b") {
+  elsif ($format eq 'b') {
     return $self->run_mbx($class, $format, $mail, $date);
   }
 }
@@ -452,7 +453,7 @@
     $date = Mail::SpamAssassin::Util::receive_date($header);
   }
 
-  return($class, $format, $date, $where, &{$self->{wanted_sub}}($class, $where, $date, \@msg));
+  return($class, $format, $date, $where, &{$self->{wanted_sub}}($class, $where, $date, \@msg, $format));
 }
 
 sub run_mailbox {
@@ -490,7 +491,7 @@
     $date = Mail::SpamAssassin::Util::receive_date($header);
   }
 
-  return($class, $format, $date, $where, &{$self->{wanted_sub}}($class, $where, $date, \@msg));
+  return($class, $format, $date, $where, &{$self->{wanted_sub}}($class, $where, $date, \@msg, $format));
 }
 
 sub run_mbx {
@@ -524,7 +525,7 @@
     $date = Mail::SpamAssassin::Util::receive_date($header);
   }
 
-  return($class, $format, $date, $where, &{$self->{wanted_sub}}($class, $where, $date, \@msg));
+  return($class, $format, $date, $where, &{$self->{wanted_sub}}($class, $where, $date, \@msg, $format));
 }
 
 ############################################################################