[Mimedefang] Gibberish in the subject line

David F. Skoll dfs at roaringpenguin.com
Tue Jul 16 10:52:01 EDT 2002


On Tue, 16 Jul 2002, Steve Ladendorf wrote:

> Has anyone written a rule to block email with gibberish in the Subject
> line like so..

> Subject: ¬[?] |h?Óºô¯¸ |h€H€Wºô |h?Ó¶l¥óªººô¸ô¥D?÷ ¥i¥H10€ÀÄÁ€º·d©w
> vFtBgl3ki3895s3BhB1LuV

You could match 8-bit characters.  Something like:

sub filter_begin {
	if ($Subject =~ /[\x80-\xFF]{7}/) {
		return action_bounce("8-bit subject");
	}
}

will drop subjects with 7 or more consecutive high-bit-set characters.

Another option is to check the character set; see
http://www.roaringpenguin.com/mimedefang/canit/recipes.php3 for an example
which drops Korean mail.

> I can't imagine that there is any reason to accept a message that contains
> characters like "Ó¶l¥óªººô" in the header.

Perhaps if you speak Korean, there is.

--
David.





More information about the MIMEDefang mailing list