[Mimedefang] Newbie - Couple of questions

David F. Skoll dfs at roaringpenguin.com
Thu Apr 24 11:28:01 EDT 2003


On Thu, 24 Apr 2003, Todd Adamson wrote:

> I have just recently installed SA 2.53 with Mimedefang 2.31 on a RH 7.3
> box.  Everything is working at the moment with the default install.  I
> have been looking at adding some of the subroutines(?) to the code to
> better filter some of the email.  My question is,  do I always add the
> new sub-routines to the "sub filter ($$$$)" section?  When I add the
> new code, does it always run because it is a sub xxx statement?  Which
> in my mind, means that I do not have to explicitely call the sub routine.

You may not like this answer, but before you play around with the filter,
you need to learn Perl.

Once you know Perl, the answers to all of your questions will be clear.

> 2nd question, is there a way to mark as spam, reject, drop, etc. emails
> that are not english?

Sort of.  You can get the character set of a MIME::Entity object
(the $entity that gets passed to "filter") by doing:

	$charset = $head->mime_attr("content-type.charset");
	if (defined($charset)) {
		# do something
	}

However, not all non-English languages use a distinct character set,
so this is hit-and-miss.  It's useful for detecting Korean or Chinese
mail, but not so good for French or Spanish.

--
David.



More information about the MIMEDefang mailing list