Blocking <something>.net/.com, except....

These are old archives. They are kept for historic purposes only.
Jason
Posts: 570
Joined: Mon Jun 14, 2004 5:09 pm

Post by Jason » Mon Oct 10, 2005 10:35 pm

The command depends on what you want to filter.

/spamfilter + cpnNPqat kill - Spamming [^@][^ @]+\.(com|net)

Or perhaps you want

/spamfilter + cpnNPqat block - Spamming [^@][^ @]+\.(com|net)

Or perhaps you want

/spamfilter + cpnNPq kill - Spamming [^@][^ @]+\.(com|net)

Or perhaps you want

/spamfilter + cpnN kill - Spamming [^@][^ @]+\.(com|net)

Or perhaps you want

/spamfilter + cN kill - Spamming [^@][^ @]+\.(com|net)

Or perhaps you want

/spamfilter + pn kill - Spamming [^@][^ @]+\.(com|net)

Or perhaps you want...

Insert 40315 other variations here. And thats just variations on one field. So now, what do you want to block the message in, and what do you want to do when its found? And why dont you want to block .org addresses?

Do you want to block all website addresses? I have a quite comprehensive spamfilter for that... I wonder, does it false positive emails... *checks*

EDIT: Hmm.. It does. *fixes*
EDIT: nm, too hacky. way too hacky. * Jason WANTS A SPAMFILTER EXCEPT ACTION. I'll write up the hacky method if you want me to for you.
Why the hell can't my signature be empty?
"Your message contains too few characters."

aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight » Tue Oct 11, 2005 3:48 am

Jason wrote:What the HELL? See the [^@] at the beginning? Emails are exempt from that regexp!
Because regex will do whatever it takes to get a match.

This is why you anchor the regex. You can use things like \s (whitespace) to anchor the match to entire words rather than parts of them, in the same way you can use ^ and $ to anchor the regex to the entire line or to the beginning or end of it. For example:

\s+[^ @]+\.(com|net)\s+

This would work, although a much better one is:

(\s+|^)[^@]+\.(com|net)(\s+|$)

which will catch urls at beginning and/or end of line.

Jason
Posts: 570
Joined: Mon Jun 14, 2004 5:09 pm

Post by Jason » Tue Oct 11, 2005 9:44 pm

I figured it out. You will notice my most recent post gave a slightly altered regexp which should fix it.
Why the hell can't my signature be empty?
"Your message contains too few characters."

cculha
Posts: 79
Joined: Tue Sep 13, 2005 1:16 am

Post by cculha » Wed Oct 12, 2005 2:14 pm

so thank you aquanight the code

(\s+|^)[^@]+\.(com|net)(\s+|$)

is working better.

now in my server nobody can send asda.net but everybody can send asda@asda.net but now i want 1 code too

nobody can send asda.net but everybody can send asda net a net baba net with blanks.

how can i block that. thank you.

Post Reply