News and Announcements > General Discussion

How to block a domain zone using a regular expression?

(1/1)

inverser:
Hello. Tell me how to block a specific domain zone in spam filters? I've tried different regex options that I could find on your forum, but none of them worked.
I started getting emails from addresses like budapest@letterladder.bio, creed@tissuekiller.bio and others. Therefore, I want to completely stop receiving emails from the *.bio domain zone. Is it possible to do this?

Dmitry42:
You can use Filter and move all messages from *.bio to trash.

inverser:
how exactly should I create it?
I tried with these settings, but the letters still come
regexp:
--- Code: ---/*/.bio
--- End code ---

Also tried (test from gmail):

--- Code: ---\^*.com$
--- End code ---

--- Code: ---/!(@(google\.com|gmail\.com)$)/
--- End code ---
...Also tried

.....

--- Code: ---/^[a-z-]+:\/\/[0-9A-Za-z]{20,}\.com/
--- End code ---

strcube:

--- Quote from: inverser on May 25, 2023, 03:42:17 PM ---how exactly should I create it?

--- End quote ---

I do this sort of thing with a combination of SpamAssassin and ProcMail (which wasn't supported for a few years but now is supported once again).

SpamAssassin looks at all inbound email and ranks them for whether or not they're spam and you can add rules that indicate to SA that it's not wanted. And then ProcMail moves it to the user's SPAM folder or just deletes it, etc. That can be done in several ways but I like (non-virtual) users to have control via their ~/.procmailrc file.

In fact, the user can do it all with ProcMail, without Spam Assassin, I think. For example, in my own ~/.procmailrc file I have (the --- lines denote start and end of an excerpt):

---
:0
* ^From:.*northlightcolor.com
spam

---

...Of course, this is done at the SMTP / MTA level as in my config, Postfix calls SpamAssassin and ProcMail...

inverser:
strcube, thank you. I'll try to figure this out.

Navigation

[0] Message Index

Go to full version