Content Filter
Content Filter
Section titled “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.
How It Works
Section titled “How It Works”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.
Configuration
Section titled “Configuration”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}| Setting | Default | What It Does |
|---|---|---|
enabled | true | Turn the filter on or off |
action | BLOCK | What to do when content matches: BLOCK rejects the mail, CENSOR replaces matched text with asterisks |
useBundledList | true | Include 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 |
checkSubject | true | Scan mail subject lines |
checkBody | true | Scan mail body text |
checkItemNames | true | Scan custom names on attached items |
checkItemLore | true | Scan lore text on attached items |
checkBookContents | true | Scan the contents of attached written books |
Custom Word List
Section titled “Custom Word List”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.
badwordanotherbadwordcustom[s$5]lurThis file is auto-created on first launch with a template and instructions. Patterns here are combined with the bundled list (if enabled).
Pattern Format
Section titled “Pattern Format”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:
badwordCharacter classes catch leet-speak variants:
b[a@4]dw[o0]rdCommon 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.
Filter Actions
Section titled “Filter Actions”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.
Bypass Permission
Section titled “Bypass Permission”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 trueWhat Gets Scanned
Section titled “What Gets Scanned”The filter checks five parts of each mail, each controlled by its own toggle:
- Subject line (
checkSubject) — the mail title - Body text (
checkBody) — the main message content - Item names (
checkItemNames) — custom display names on attached items - Item lore (
checkItemLore) — tooltip text on attached items - 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).
Error Messages
Section titled “Error Messages”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.
Reloading
Section titled “Reloading”Filter patterns reload when you run:
/mailadmin reloadThis picks up changes to both config.conf (filter settings) and filter_words.txt (custom patterns).
Next Steps
Section titled “Next Steps”- Moderation & Safety — rate limiting, blocking, and other abuse prevention
- Main Config — all config.conf settings
- Permissions — full permission reference