> -----Original Message-----
> From: Kai Schaetzl [mailto:[EMAIL PROTECTED] 
> 
> Herb Martin wrote on Tue, 26 Jul 2005 21:21:25 -0500:
> > When forwarding a batch of missed spam (or ham) from 
> > Outlook back to 
> > SpamAssassin the best way seems to be for our users to select more 
> > than a single message, and use the menu:  Action->Forward 
> > which puts them all in as attachments.
> 
> I guess this adds only the message bodies? Just want to 
> remmember you that Bayes uses header tokens as well. If you 
> can you should train with headers included.

I understand the latter, but No, the method sends the full
headers/messages encapsulated as message/rfc822 top level parts.

The only change I see between the Mime Markers are these 4
lines (including the blank):

------=_NextPart_000_067D_01C591D1.7F02A7C0
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment

From:  etc.............
<snip header and body>

------=_NextPart_000_067D_01C591D1.7F02A7C0

FYI:  Mail::SpamAssassin::Message (and Node) do seems to
have what I need, but so far on quick examination and a
brief initial code attempt it escapes my understanding
to use this immediately.

After writing the following and trying 
Mail::SpamAssassin::Message (off and on all afternoon)
I stumbled upon the tool intended for the job:

MIME::Parser from MIME::Toolkit (which was already on
my system) -- the pod doc examples had almost exactly
what I need (added one line to first example):

<http://www.globedomain.com/cgi-bin/perldiver/perldiver.cgi?action=2010&modu
le=MIME%3A%3AParser>

This does it -- the whole thing -- if I don't mind 
submitting one file per run (with a command script
loop for all of them of course):

#!/usr/bin/perl -w

use MIME::Parser;

my $parser = new MIME::Parser;       # Create parser
$parser->output_dir("./tmp");        # Give output dir
$parser->extract_nested_messages(0); # Extract messages whole?    
$entity = $parser->parse(\*STDIN);   # Parse an input filehandle  
print "Entity: $entity\n\n" if $entity;

__END__

This method is so much cleaner than the others I have
tried -- users can just email a whole batch of Spam
(or Ham) messages to our Spam (or Ham) "Multi" account
for automatic processing.  No change to individual 
message headers -- easy to do once or twice a day for
those who get a lot of spam.

Thank you so much for your help -- sometimes it is 
encouraging just to have someone throwing back ideas
and suggestions.

--
Herb

Reply via email to