1

Topic: Filter by text in body or subject

Hi there,

I want to create a manual filter based on a string on subject or body of message. Can you point me where to start?

For a specific reason, I dont want some of my users receive messages with "Undelivered Mail Returned to Sender" on subject.

Let me know where to look. I dont know if it's a SpamAssassin local.cf, or Amavis or other place...

Thank you!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Filter by text in body or subject

You can try either one:

1) For English strings, you can try Postfix header_checks(5) and/or body_checks.

2) Use SpamAssassin instead. Reference: http://wiki.apache.org/spamassassin/WritingRules

3 (edited by InWeb 2013-03-28 06:56:44)

Re: Filter by text in body or subject

Thank you Zhang.

iRedMail installation read rules in /etc/mail/spamassassin/local.cf? Can I create in there?

Another question: to avoid user receive the message (ie, he wont receive a message with ***SPAM*** on subject, the message will be discarded), can I just score 100.0? Is this correct?

Thank you.

4

Re: Filter by text in body or subject

InWeb wrote:

iRedMail installation read rules in /etc/mail/spamassassin/local.cf? Can I create in there?

Yes.

InWeb wrote:

Another question: to avoid user receive the message (ie, he wont receive a message with ***SPAM*** on subject, the message will be discarded), can I just score 100.0? Is this correct?

Wrong.
Score it at 100.0 just means it will be marked as SPAM. To drop this spam, try either one:

1) Set '$final_spam_destiny = D_DISCARD;" in Amavisd config file. Then spams will be discarded directly.
2) Use global sieve rule to discard it. Search "global_sieve_path" in Dovecot config file please.

5

Re: Filter by text in body or subject

Perfect, thank you Zhang. You gave me some idea where to start.