Yes, it can be done using MCP.
Read the following threads:
1/
can we block and unblock using subject
2/
Using MCP to block offensive content
3/ if you want to be able to release the messages from quarantine, make sure to
do this step.
MCP is essentially a second spamassassin filter that you can also use for blocking mail. MCP = Message Content Protection. Since it is really spamassassin in disguise, you'll need to
write spamassassin rules to control what gets blocked.
Following the instructions in link 2/, I enabled the MCP quarantine and added the following rules to /etc/MailScanner/mcp/10_example.cf
Code: Select all
header MCP_TEST Subject =~ /MCP-test/i
describe MCP_TEST test banned subject
score MCP_TEST 10.0
(since it is just a test, I only targeted the subject)
Once I'd "service reload MailScanner", sending messages in, or sending messages out with that text in the subject would immediately be quarantined by MCP.
Viewing the quarantine shows the messages trapped, and I could "release" them to send them on their way, or delete them if I so wanted.
Modify your rules to meet your conditions (from/to headers, plus a score), See the link to writing spamassassin rules on how to do that:
https://wiki.apache.org/spamassassin/WritingRules. Personally, I just look in /var/lib/spamassassin/3.*/updates_spamassassin_org/ directory at some of the existing rulesets and find one that meets my needs.
Is this ideal, or as nice and simple as SMG? No. However, there was mention of adding a gui interface for modifying the MCP rulesets
in this thread.
Hope that helps.