[Mimedefang] quarantine_entire_message: I don't get it

Paul Boven p.boven at chello.nl
Wed Sep 22 09:32:42 EDT 2004


Hi David, everyone,

David F. Skoll wrote:
>>*nod* I will have to look into that, then. I can see why you would call
>>that 'intentionally difficult' yes ;-)

> It's not that bad.  You can do it like this (untested!):
> 
> 	my $msg = MIME::Entity->build(Type => "text/plain",
> 				      Encoding => "7bit",
> 				      Data => ["first line.\n",
> 					       "Second line.\n"
> 					      ]);
>         replace_entire_message($msg);
>         action_change_header("Subject", "Virus warning");

This generally works, as long as the message in question was a 
"text/plain" message to begin with.
Almost every virus is in a "multipart/mixed" message however, and 
despite the fact that the 'Type' of the new MIME::Entity gets set to 
"text/plain", the new message retains the original 'Content-Type:' 
header, including the 'boundary' specification.

Appending 'action_change_header("Content-Type","text/plain");' doesn't 
help here either. Is there a way to change the Content-Type header that 
I should have used apart from setting it in the new entity or calling 
change_header?
In the current situation, people don't get to see the warning message 
because the mailer expects a multipart message, but then it turns out 
not to have any mime parts.

Regards, Paul Boven.



More information about the MIMEDefang mailing list