Skip to content

Content Filter

Courier scans mail for prohibited content before it’s sent — hate speech, slurs, and anything else you want blocked. It’s enabled by default with a bundled word list, and you can add your own patterns.


When a player sends mail, Courier checks the subject, body, and any attached item names, lore, and book contents against a list of regex patterns. If something matches, the mail is blocked and the player sees an error.

Admins with the bypass permission skip the filter entirely.


The filter lives in your main config file as the filter section.

File: config/courier/config.conf

filter {
enabled = true
action = BLOCK
useBundledList = true
customPatterns = []
bypassPermission = "courier.filter.bypass"
checkSubject = true
checkBody = true
checkItemNames = true
checkItemLore = true
checkBookContents = true
}
SettingDefaultWhat It Does
enabledtrueTurn the filter on or off
actionBLOCKWhat to do when content matches: BLOCK rejects the mail, CENSOR replaces matched text with asterisks
useBundledListtrueInclude Courier’s built-in hate speech patterns
customPatterns[]Your own regex patterns to match against
bypassPermission"courier.filter.bypass"Permission node that skips the filter
checkSubjecttrueScan mail subject lines
checkBodytrueScan mail body text
checkItemNamestrueScan custom names on attached items
checkItemLoretrueScan lore text on attached items
checkBookContentstrueScan the contents of attached written books

Add your own blocked words and patterns in a separate file:

File: config/courier/filter_words.txt

# Custom filter patterns for your server
# One pattern per line. Supports regex.
# Lines starting with # are comments.
badword
anotherbadword
custom[s$5]lur

This file is auto-created on first launch with a template and instructions. Patterns here are combined with the bundled list (if enabled).


Patterns use Java regex syntax. Courier automatically adds word boundaries (\b) around your patterns so they don’t match inside other words.

Simple patterns match exact words:

badword

Character classes catch leet-speak variants:

b[a@4]dw[o0]rd

Common substitution classes:

  • [i1!|l] — matches i, 1, !, |, l
  • [e3] — matches e, 3
  • [a@4] — matches a, @, 4
  • [o0] — matches o, 0
  • [s$5] — matches s, $, 5

All matching is case-insensitive.


BLOCK (default) : The mail is rejected entirely. The player sees an error message and nothing is sent.

CENSOR : Matched words are replaced with asterisks. The mail is still sent, but the prohibited content is hidden.


Players with the courier.filter.bypass permission skip the filter. By default, ops (level 4) bypass automatically.

You can change the permission node in config:

filter {
bypassPermission = "courier.filter.bypass"
}

Or set up a LuckPerms group:

/lp group admin permission set courier.filter.bypass true

The filter checks five parts of each mail, each controlled by its own toggle:

  1. Subject line (checkSubject) — the mail title
  2. Body text (checkBody) — the main message content
  3. Item names (checkItemNames) — custom display names on attached items
  4. Item lore (checkItemLore) — tooltip text on attached items
  5. Book contents (checkBookContents) — pages of any attached written books

If any check finds a match, the whole mail is blocked (or censored, depending on action).


When mail is filtered, the player sees:

  • Primary: “Your message was blocked by the content filter.”
  • Detail: “Prohibited content detected in {location}.”

Where {location} is one of: “subject”, “message body”, “item name”, “item lore”, or “book contents”.

These messages are customizable in messages.conf under the contentFiltered and contentFilteredDetail keys.


Filter patterns reload when you run:

/mailadmin reload

This picks up changes to both config.conf (filter settings) and filter_words.txt (custom patterns).