Adding Regular Expressions to Spam Filter

To block emails based on their content or subject using regular expressions (regex), you can add these regex patterns to for subject filtering and for content filtering. Below are the steps to achieve this via the Rspamd Web UI.

Accessing Rspamd Web UI

  1. Log into the Rspamd Web UI:
    • Navigate to the Server Status section.
    • Click on the RSPAMD UI button.

Editing the Custom Maps

  1. Navigate to Configuration: - Once in the Rspamd Web UI, go to the Configuration section from the navigation menu. - Locate the Lists section.

  2. Edit or - Find and select to edit subject filters. - Find and select to edit content filters.

  3. Add Regular Expressions: - Each regex pattern should be on a new line. - The regex must start and end with a / and include appropriate parameters (e.g., i for case-insensitive, u for Unicode). - Save changes after adding your regex patterns.

Example Regular Expressions

To block emails with specific words or patterns in the subject, add patterns to For example:

/Free Money/i
/Peníze zadarmo/iu
/Win a Prize/iu

For more information about blocking spam, see the RSPAMd manual, especially the multimap module.