Print Page | Close Window

Regular Expression Help

Printed From: LogSat Software
Category: Spam Filter ISP
Forum Name: Spam Filter ISP Support
Forum Description: General support for Spam Filter ISP
URL: https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=5343
Printed Date: 01 July 2025 at 3:47pm


Topic: Regular Expression Help
Posted By: fischer
Subject: Regular Expression Help
Date Posted: 25 September 2005 at 10:52pm

I'm trying add an entry to the blocked to addresses blacklist that will block everything sent to a particular domain except if it is one of three valid addresses.

Lets say that the addresses are mailto:test1@test.com - test1@test.com , mailto:test2@test.com - test2@test.com , and mailto:test3@test.com - test3@test.com . How do I configure a regular expression to block everything to @test.com except for that which is sent to the above addresses. Incidentally, I don't want to add these addresses to the white list of unprocessed addresses, as I'd still like the other spam checks to apply to these three addresses.

Also, does anyone have a filter application order that tells what order the spam checks are applied in? Are all the remaining checks ignored if a match is found?




Replies:
Posted By: fischer
Date Posted: 06 October 2005 at 1:02am

I figured out a workable solution. Since the domains I want to do this for only have a couple of addresses, I was able to configure a RegEx to block all mail going to addresses that started with something other than the first letter of the legitimate email accounts. In the example scenario above, all the addresses start with a 't', so I would tell spamfilter to reject messages that have to addresses that match this:

(^[abcdefghijklmnopqrsuvwxyz].*@test.com)

Explanation: the () are necessary for the black list to interpret it as a RegEx

the ^ designates look at the beginning of the line

the [abc..] (notice the 't' is not there) matches one and only one of any of those characters

the .* matches anything after the first character, regardless of character or length

the @test.com matches "@test.com" (actually it would also match @testacom, @testbcom, @testccom, etc, but that's not really a concern. If I only wanted it to match "@test.com" I would put in @test\.com so the Spam Filter would know that the . is actually a period and not a placeholder for any character.)




Print Page | Close Window