Chapter 9 · 9.2
SPAM Filters: blocking senders, domains and words
With SPAM Filters you block mail based on a fixed rule: a specific address, an entire domain, a word or a size. This is useful for spam that SpamAssassin still lets through, or for a sender you really never want to hear from again. The filters apply to the whole domain, so to all mailboxes of that domain at once.
Adding a filter
- In the menu, click SPAM Filters under E-mail Manager.
- Check at the top right that the correct domain is selected.
- Under Block By (1), choose what you want to filter on (see the table below).
- Under Value (2), enter the address, domain, word or number.
- Click Block (3) or press Enter. The filter will then appear in the list.

| Block By | What do you enter? | Example |
|---|---|---|
| One complete sender address. | offer@advertisingcompany.com | |
| Domain | Everything after the @. All mail from that domain will be blocked. | advertisingcompany.com |
| Stop word | A word that appears in the subject or body. | casino |
| Size | Messages above this size will be blocked. Click the question mark next to the drop-down list for an explanation of the unit. | Only in special cases. |
Please note: A stop word also matches parts of words. If you block a short word, you might also block regular mail in which that word appears as part of another word. So choose a word that really only appears in spam.
What happens to blocked mail
Below the list you'll find the Options:

- Adult filter (2): if you tick this box, DirectAdmin will also block mail containing words that point to adult content.
- Action for filter matches (3): choose Drop E-mail to discard the mail immediately, or Send to spambox to move it to the spam folder. If in doubt, choose the spambox: that way you can still find a mail that was blocked by mistake.
Deleting a filter
Tick the filter in the list and click Delete at the top right.
Frequently asked questions
Can I create a filter for a single mailbox? No, SPAM Filters apply to the whole domain. If you want to sort or discard mail per mailbox, create a rule in your e-mail program, such as Outlook, Apple Mail or Thunderbird.
What's the difference with SpamAssassin's blacklist? The blacklist in SpamAssassin (see SpamAssassin Setup) marks mail as spam, after which your Blocking strategy setting determines what happens to it. A SPAM Filter blocks the mail immediately, even if SpamAssassin is switched off. In addition, with a SPAM Filter you can also filter on words and size.
The spam keeps coming from a different address. In that case, a filter on a single address won't help. Block the domain if that stays the same, or use a stop word that appears in all those messages. Also make SpamAssassin stricter (see SpamAssassin Setup).
