Dovecot Sieve and Postfix header_checks Issue
Alex Crow
acrow at integrafin.co.uk
Fri Sep 26 13:34:54 UTC 2014
On 26/09/14 14:10, Klaipedaville on Google wrote:
> Hey! You are right Alex! Many thanks for pointing me to head over to
> the right direction!
> It was a clash on rules for some reason. Now, I was also right that
> these two systems could not be used together because the rules
> declared in different systems to perform the same action (REJECT)
> cause the error I was having!
> The following rule in default.sieve:
> require ["reject"];
> # rule: Reject on "x-spam-flag" header
> if header :contains "X-Spam-Flag" "YES" {
> reject "No spamming allowed here.";
> stop;
> }
> and the following Postfix's regexp header_check rules on the subject
> field:
> /^Subject:.**{5}SPAM*{5}/ REJECT No spammers allowed here.
> /^Subject:.*\*\*\*\*\*SPAM\*\*\*\*\*/ REJECT No spammers allowed.
> /\s**{5}SPAM*{5}/ REJECT No spamming
> hullababballos allowed.
I think it may be this one above. From the postfix manuals:
"By default, matching is case-insensitive, and newlines are not treated
as special characters. The behavior is controlled by flags, which are
toggled by appending one or more of the following characters after the
pattern: *i* (default: on) Toggles the case sensitivity flag. By
default, matching is case insensitive."
And it looks like * needs escaping there too (if you're trying to match
exactly 5 asterisks, you should probably do "\*{5}" not just *{5}.
> /^Subject:(.*)SPAM/ REJECT Spam is not allowed.
> DISCARD.
> were causing the Dovecot Sieve rejection bounce not to go through. The
> rules blocked the spam all right but rejection was turned into discard
> for some reason.
> Now the question is how do I find out which regular expressions will
> be in conflict with default.sieve scripting rules?
That's just about learning Posix Regex syntax.
> Default.sieve is set to block spam on the X-Spam-Flag header and
> header_checks is set to block spam on the subject field. I am still
> clueless why didn't these two "cooperate"? Was it just because they
> were "told" to perform the same action as per my previous guess?
I'm almost 100% sure that that regex also matched the bounce from your
sieve rules. There is no mysterious interaction between header_checks
and sieve rules, it's just your pattern was too liberal in the former.
> But the target to perform this same action on was different... Any
> more ideas anyone? Alex? Many thanks in advance for any input!
I think if you tune that header_checks file correctly you should have no
more issues.
Thanks
Alex
--
This message is intended only for the addressee and may contain
confidential information. Unless you are that person, you may not
disclose its contents or use it in any way and are requested to delete
the message along with any attachments and notify us immediately.
"Transact" is operated by Integrated Financial Arrangements plc. 29
Clement's Lane, London EC4N 7AE. Tel: (020) 7608 4900 Fax: (020) 7608
5300. (Registered office: as above; Registered in England and Wales
under number: 3727592). Authorised and regulated by the Financial
Conduct Authority (entered on the Financial Services Register; no. 190856).
More information about the dovecot
mailing list