Problems adding Custom SpamAssasin Plugin

Lenu

Active Member
Jan 14, 2019
11
0
41
33
Hi! We are encountering an issue with our custom SpamAssassin plugin on our Proxmox Mail Gateway (PMG) setup (version 4.0.1). We have developed a plugin intended to check for “BCC-only” emails—i.e., emails where the recipient address appears only in the envelope headers (Delivered-To or X‑Original-To) and not in the visible “To” or “Cc” fields.

We created a custom plugin (e.g., CheckBcc.pm) and placed it in the directory:
/etc/mail/spamassassin/CheckBcc.pm

This plugin includes our evaluation function (e.g., check_exclusive_bcc()) and registers the eval rule using register_eval_rule.
We added a configuration file (e.g., custom.cf) in:
/etc/mail/spamassassin/custom.cf
Code:
loadplugin /etc/mail/spamassassin/CheckBcc.pm
header __BCC_ONLY_RECIPIENT eval:check_exclusive_bcc()
describe __BCC_ONLY_RECIPIENT "Envelope address not present in visible To/Cc fields"
score __BCC_ONLY_RECIPIENT 3.

Our tests using spamassassin --lint indicate that the configuration is syntactically correct and the rule assigns the proper score.

The Problem:
Our custom plugin passes the lint test, and debugging output confirms that the eval rule is triggered (score is added). Despite this, during real email processing the rule does not seem to be applied (i.e., the final email score does not reflect the custom plugin’s impact).

What are the recommended procedures for adding and enabling custom SpamAssassin plugins in PMG?
Do you have any guidance on why a plugin that is correctly loaded (as confirmed by lint and debug output) might not affect the score or processing of live emails?