[Mimedefang] filter recipient regex

Jason Gurtz jason at jasongurtz.com
Thu Nov 22 01:05:28 EST 2007


On 11/21/2007 08:53, Paul Houselander wrote:
> 
> I get a lot of dictionary attacks for a particular domain and there always
> in the format
> 
> s172hsgw.876 at custs.dom.com
> 
> i.e. "s" + 7 alpha numeric chars + "." + 3 alphanumeric chars + @domain
> 
> if($recip =~ /<?s([0-9a-z]{7}).([0-9]{3})+(\@custs\.dom\.com)>?/){
>  return ("REJECT","No such user","550","5.1.1");
> }
> 
> but it doesnt work, can anyone help/suggest what I should be doing?

Forgot to escape the first dot and 3 chars before "@" are tested just
for digits.  For that matter I'm not certain without looking about
matching @ in perl since it's part of the language.  It may help
troubleshooting to assign the regex (in single quotes) to a scalar and
operate with that

Completely off the top of my head at this late hour after baking all
evening I'd try something like:

my $matchBadAddy = '<{,1}s\w{7}\.\w{3}@custs\.dom\.com>{,1}';
if( $recip =~ /$matchBadAddy/ ) }
    return ...
}

also unsure about necessity of matching angle brackets....

~Jason

-- 



More information about the MIMEDefang mailing list