Daniel Quinlan wrote:
> Matt Sergeant <[EMAIL PROTECTED]> writes:
> 
> 
>>Yeah, I've got that working here. It's a pretty trivial change to 
>>SpamAssassin, but I haven't gotten around to integrating it yet. It's 
>>just a matter of setting the content-type to multipart/mixed, and set 
>>the first part to text/plain, and the second part to message/rfc822.
> 
> 
> Can the message/rfc822 part be a bit-for-bit copy of the original
> message?

Yes. Here's the code if you're curious:

open(FILE, ">../Maildir/.Spam/tmp/$name");
print FILE "From matt\@spambox\n",
   "Date: ", $results->{msg}->get_header('date'), "\n",
   "Subject: ",
   $results->{msg}->get_header('subject'), "\n",
   "From: ",
   $results->{msg}->get_header('from'), "\n",
   "Content-Type: multipart/mixed; boundary=\"--$name\";\n",
   "\n",
   "This is a MIME message\n\n",
   "----$name\n",
   "Content-Type: text/plain\n",
   "\n";
print FILE $results->get_report;
print FILE "\n\n----$name\n",
   "Content-Type: message/rfc822\n",
   "\n";
open(SOURCE, "email.eml") || die $!;
while(<SOURCE>) {
   print FILE $_;
}
close(SOURCE);
print FILE "\n\n----$name--\n";
close(FILE);
rename("../Maildir/.Spam/tmp/$name", "../Maildir/.Spam/new/$name");

(it's based on Maildir's, and the boundary is bogus, but it mostly works).

Matt.


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to