Artica Wiki

SpamAssassin scoring in milter rules

Use a SpamAssassin score as a rule condition: the Spamassassin Connector object scores each message via spamd and matches at your threshold — you choose the action (reject, tag, copy...).

The Spamassassin Connector object lets any Artica Milter rule use a SpamAssassin verdict as a matching condition. During evaluation, the milter submits the full message to the local SpamAssassin daemon (spamd) and the object matches when the returned spam score reaches your threshold. You decide what happens next with the rule's action: reject, discard, tag the subject, copy to a mailbox...

How it works

  1. A message reaches a rule whose objects include a Spamassassin Connector.
  2. The milter sends the complete message to spamd on 127.0.0.1:783 for scoring.
  3. spamd returns the SpamAssassin score (headers, body, network tests — whatever your SpamAssassin configuration enables).
  4. The object matches when the score is greater than or equal to the threshold you configured (default 5, the standard SpamAssassin spam level).
  5. Like any object, it combines with the rule's other objects with a logical AND — and the rule's action decides the message's fate.

Advantages

Prerequisite

A SpamAssassin daemon must listen on 127.0.0.1:783 on the gateway. Verify it from the console:

ss -ltn | grep 783        # spamd listening?
echo "test" | spamc -R    # returns a score report when spamd answers

If SpamAssassin is not installed yet, deploy the SpamAssassin service (e.g. the distribution's spamassassin package or Artica's content-filtering stack) before enabling rules that use this object.

Build an anti-spam rule

1. Create the rule that will carry the consequence — for example a Reject (notify) rule named Reject spam messages (see Rule actions).

2. Open the rule, select the Objects tab and click New object. Choose the type Spamassassin Connector, give it a name (e.g. SpamAssassin score):

milter-spamc-rule-objects.png

3. Open the object: the Spamassassin Connector tab exposes a single parameter — the score threshold (0 to 10, default 5). Scores equal or higher make the object match:

milter-spamc-score.png

4. The rules list now reads as a full sentence — for objects «SpamAssassin score» (spamc) then Reject (notify):

milter-spamc-rules-list.png

Choosing the threshold

Threshold Behaviour
3 Aggressive — catches more spam, higher false-positive risk. Prefer non-destructive actions (Prepend, BCC).
5 SpamAssassin's standard spam level — the recommended starting point for Reject/Discard.
8–10 Only blatant spam — safe for hard reject even on sensitive mail flows.

Use cases

Scoring submits the whole message to spamd for each evaluated rule — place SpamAssassin rules after your allow/whitelist rules so trusted flows skip the scoring cost entirely.