poste.io2

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 custom_subject_content.map for subject filtering and custom_regex_content.map 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 custom_subject_content.map or custom_regex_content.map:

    • Find and select custom_subject_content.map to edit subject filters.
    • Find and select custom_regex_content.map 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 custom_subject_content.map. 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.