[Mimedefang] Where in the filter is the virus scanner called?

David F. Skoll dfs at roaringpenguin.com
Sun Apr 21 17:53:01 EDT 2002


On Mon, 22 Apr 2002, Anthony Giggins wrote:

> OK, but you didn't answer my other question can you also block by Sender
> and/or attachment extension and maybe even via Subject in filter begin.
> Before the message is actually scanned.

Yes.  Just set a flag like this:

sub filter_begin {
	$Handled = 0;
	if ($Sender eq "<badsender at badboys.org>") {
		$Handled = 1;
		return action_bounce("Sorry.");
	}

	if (!$Handled) {
		# Do virus-checking
	}
}

sub filter {
	if (re_match_ext("..whatever..")) {
		return action_quarantine();
	}
	if (!$Handled) {
		# Do virus-checking
	}
}

> I'm attempting to cut down on as much over head as possible so
> performing all these blocks before the message is scanned will cut down
> on as much as possible and will only call the virus scanner as a last
> ditched effort to protect users.

Yes.  It's Perl, so you can code it.  It's guaranteed that for a given
e-mail, global variables set in filter_begin persist into filter.

Regards,

David.




More information about the MIMEDefang mailing list