Page 2 of 2

Posted: Mon Oct 10, 2005 10:35 pm
by Jason
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.

Posted: Tue Oct 11, 2005 3:48 am
by aquanight
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.

Posted: Tue Oct 11, 2005 9:44 pm
by Jason
I figured it out. You will notice my most recent post gave a slightly altered regexp which should fix it.

Posted: Wed Oct 12, 2005 2:14 pm
by cculha
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 [email protected] 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.