Updated: 16 November 2026 · Applies to: DirectAdmin (Evolution skin) with Exim

To stop mail that contains a particular word, open SPAM Filters in DirectAdmin, choose the option to block messages containing a word, type the word and add it. From then on, any incoming message for that domain whose subject or body contains the word is caught by the filter. Pick the word carefully: the match is broad, as the tests further down show.

Steps

  1. Log in to DirectAdmin (usually https://your-server:2222; the address is in your welcome email).
  2. Open SPAM Filters (you can type its name in the menu search box). If you have several domains, select the domain that receives the unwanted mail.
  3. Choose the block-by-word option.
  4. Enter one word or short phrase, for example casino, and add it. The filter appears in the list of active filters on the same page.
  5. Repeat for each word you want to block. Each word is a separate filter.

According to DirectAdmin's changelog, filters on that page can either drop a matching message or send it to the spam folder. If your page offers that choice, the spam folder is the safer option while you are still testing a new word.

What the word filter checks

According to DirectAdmin, SPAM Filters are a basic Exim filter that acts on messages the server has already accepted, and the word search covers the message subject and body. A word filter applies to the whole domain, so it affects every mailbox on that domain, not only yours.

We tested a rule of this kind with Exim 4.98.2 in a lab container (Debian 13), checking a sample message with exim -bF. The rule used Exim's contains test on the subject and the body:

if $header_subject: contains "casino" or $message_body: contains "casino"
then
  seen finish
endif

Results from that lab test:

  • Subject "Free casino bonus": caught.
  • Subject "CASINO night": caught. The match ignores upper and lower case.
  • Subject "Hello" with "casino" only in the body: caught.
  • Subject "Casinos near you": caught. A word also matches inside a longer word.
  • Subject "Invoice" with no match: delivered normally.
  • "casino" placed after the first 700 characters of the body: not caught. Exim only looks at the first part of the body, set by message_body_visible (500 characters by default; your server's setting may be different).

Output for a caught message:

Testing Exim filter file "filter"

Seen finish
Filtering set up at least one significant delivery or other action.
No other deliveries will occur.

Output for a clean message:

Filtering did not set up a significant delivery.
Normal delivery will occur.

The exact rule DirectAdmin writes for you may differ in detail, but the lesson is the same: a short word matches much more than you expect. Blocking sex, for example, would also catch "Sussex" and "Essex".

Choosing good words

  • Use words or phrases that appear only in the spam you receive, such as an unusual product name or a phrase repeated in every copy.
  • Avoid short or common words (free, offer, win, loan). They match real mail from customers and suppliers.
  • A longer phrase such as casino bonus is safer than a single word.
  • Spammers change spelling often ("c4sino"), so a word list needs looking after. For spam that varies a lot, SpamAssassin scoring works better than a list: see How to Enable Apache SpamAssassin in DirectAdmin for Spam Protection.

Related filters and undoing a mistake

Official documentation: DirectAdmin, preventing spam.

Related services

Server management

on-demand administration, hardening, migrations and monitoring.

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Was this answer helpful?

Still stuck? Open a ticket