[Mimedefang] Help with filter script to attach original SPAM as message/rfc822

David F. Skoll dfs at roaringpenguin.com
Mon Mar 3 08:21:15 EST 2003


On Mon, 3 Mar 2003, Michael Sims wrote:

> So, I feel a bit silly about that (I guess I should have examined
> the mimedefang.pl source before posting) but I'm still curious if
> anyone has any thoughts on how I may improve the efficiency of my
> filter, or if anyone has attempted to attach the original spam as
> message/rfc822 like I am...

filter_end gets passed a MIME::Entity representing the (possibly reconstructed)
message.  You can manipulate that already-parses MIME::Entity; the only caveat
is that you must call action_rebuild() to force MIMEDefang to rebuild the
message if you make changes.  In other words:

sub filter_end ($) {
	my($entity) = @_;

	if (...) {
	    # Manipulate $entity to include original entity as RFC822 message
	    action_rebuild();
        }
}

It's a little tricky because you have to do it "in-place" in $entity, but
I'm sure it's doable.

--
David.



More information about the MIMEDefang mailing list