[Mimedefang] Using a db for subject lines to block

James Ebright jebright at esisnet.com
Tue Jun 21 10:10:30 EDT 2005


On Mon, 20 Jun 2005 16:12:06 -0400, Cormack, Ken wrote

.....snip.....
>         $lc_subject =~ s/ /./g;
.....snip.....
>             @subject_array = split (/\./, $lc_subject);
.....snip.....
> The format of the source file used to build the hashed database is simply:
> 
> 	words.of.text	REJECT
> 	more.words		REJECT
> 	another.spam.subject	REJECT
.....snip.....

Looking at the code snippets above, you will notice you are converting a
single whitespace into a 'dot' (.)

When you have multiple spaces you will end up with nulls in the middle of your
@subject_array and your source file will need to have a dot per every
whitespace for the exact match to work.

tabs I dont think are allowed in a subject, but hey, since when have spamm,ers
followed the rfc? a tab would not be interpreted at all by your code.

I am not sure if either of the above would break anything as perl is pretty
forgiving of these things. However, you might consider substituting on
whitespace like so:

$lc_subject =~ s/\s/./g;

which will squish multiple spaces down to a single dot, this might make your
source file smaller as well and would handle tabs as well.

Jim

--
EsisNet.com Webmail Client




More information about the MIMEDefang mailing list