Handling SPAM

Filtering emails in the client

If the mail server determines based on certain criteria that an email is spam, it adds the entry X-Spam: Yes to the header of that message.

In email clients such as MS Outlook, Mozilla Thunderbird, or Apple Mail, filter rules can be defined to process emails based on these server-side markings. The tags set by the server using analysis tools like rspamd can thus be used independently of external filtering services.

Server and Client – Who Does What?

Spam detection and handling occur on multiple levels:

  • The mail server evaluates each incoming message and, if necessary, adds markings (e.g., header entries or subject line modifications).
  • The email client can read these markings and perform automated actions based on them—such as moving or deleting messages.
  • Additionally, there is the option to enable local spam detection on the user’s system (e.g., with SpamAssassin) for an extra layer of evaluation.

The following table shows which tasks are performed at which level and who is responsible:

Level Purpose / Function Tool / Mechanism Configured by
Server-side filter Analyzes each incoming email, scores for spam, adds markings rspamd Server administrator (us)
Client-side filter Processes emails based on markings (e.g., moving, deleting, whitelisting) Email client filter User
Client-side analysis (optional) Independent local evaluation in addition to server scoring SpamAssassin (locally installed) User

Example: Setting up filters in Thunderbird

In Thunderbird, the dialog for creating filters is located under Tools → Message Filters (the name may vary depending on the version).
For example, the following rule can be defined under “Customize”:

  1. Condition: X-Spam contains Yes
  2. Action: Move message to the “Junk” folder

This allows server-marked messages to be processed appropriately in the client.

Viewing Mail Headers

To make the headers added by the server (such as X-Spam: Yes) visible, most email programs allow viewing the full message source:

  • Thunderbird: Right-click the message → “View Source”
  • MS Outlook: Open the message → “File” → “Properties” → “Internet headers” section
  • Apple Mail: Menu “View” → “Message” → “All Headers” or “Raw Source”

There, all metadata and header lines of the message can be inspected.

essential