Using DA "SPAM Filters" to block domains using wildcards?

jlpeifer

Verified User
Joined
Jun 6, 2006
Messages
97
Over the last month personal email account is getting hammered with SPAM from email addresses with ".eu" domains. Is it possible to use the "User --> E-Mail Mangement --> SPAM Filters --> Block mail from an entire domain" option to block any incoming mail that ends with the extension ".eu"?

I've tried things like "*.eu" and "%.eu" (without the quotation marks), but all I get in return is, "Error setting the filter ... Invalid domain".

I don't want to set this kind of filter globally and cause problems for the customers who are hosting their domains on my server.
 
I'm going to sort-of answer my own question here... a work-around that seems to work, although it's a bit of a Frankenhack.

I ended up editing my /etc/system_filter.exim file with this...

Code:
## -----------------------------------------------------------------------
# Drop inbound mail coming from .eu domain to foobar.com addresses
if $h_From: contains ".eu"
then
        if $recipients: contains "foobar"
        then
                seen finish
        endif
endif

Seems to work. Anyone see any down-side to this approach?

Sure would be nice if I could wildcard domains within the control panel.
 
Have you tried only adding .eu in the control panel and then checking the code in the file to see what it does and how it does it?

Jeff
 
I'm not sure where I'd add what you're suggesting other than the "User --> E-Mail Mangement --> SPAM Filters --> Block mail from an entire domain" to which I referred. It appears that attempting to add anything in that field other than a FQDN results in an "Invalid domain" error.

Am I missing something?

(the resultant error inhibits anything from being added to 'filters' or 'filters.conf' files... so there's nothing to check that I know of)
 
Last edited:
First figure out which file holes the sam filters; I forget so I'll leave it up to you.

Then add a fully qualified domain name (for example, example.com) to the filter, and search for it in the file.

Then study the code to see if looks like it'll do what you want with only .eu instead ofyour test contents.

If you think it will, then manually change that fqd you entered to what you really want.

And try it :)

Jeff
 
Is there a nice solution for this? Currently I have a lot of tld's in my User SpamAssasin blacklist like;

Code:
*@*.bg
*@*.bid
*@*.biz
*@*.br
*@*.camera

Only I found out today that the e-mail is completely dropped and isn't send to the users spam folder. So in E-mail Management -> SpamAssassin I have the above TLD filters and the e-mail is completely dropped. In E-mail Management -> SPAM Filters I can't use wildcards to only block TLDs because I have to enter a full domain name.
 
Back
Top