Henrik K a écrit : > On Wed, Oct 22, 2008 at 02:05:02PM -0300, Reinaldo de Carvalho wrote: >>> Sorry but developing stupid regexpes anywhere is not appropriate, especially >>> when it can be done right. But hey, you are free to block /.*/ if you want, >>> who am I to judge. It certainly blocks spam! >>> >>> >> Regexp to reject "generic hostname" like dialup, dsl, cable, is not stupid. > > I guess you have missed the point entirely. The regex HAS FPS with > multi-level TLDs. So it is stupid and buggy. > > If it's fixed, it's not stupid anymore. > > Best way is to code a policy server with that can split domains, using for > example Mail::SpamAssassin::Util::RegistrarBoundaries. Or then just create a > big regex containing all the TLDs. >
If it's just for boundaries, you can do it like this (will miss some, but better FN than FP): /yourpattern.*\.[^\.]+\.([^\.]+\.[^\.]{2}|[^\.]{3,})$/ but even that isn't enough. the expressions must be "protected" even if they are not in the top 2/3 labels. so instead of /dhcp/, on should use /[-\.]dhcp[-\.]/ and so on. while I am in, here are some funny ones: /\.in-addr\.arpa\./ /\.nodnsyet\./ /\.unknown\./ /\.unassigned\./ ... etc. now all this depends on what you do with...