[sieve] sieve not working on mail in a box

sieve-mailing-list@diversity.nl Fri, 29 July 2022 14:33 UTC

Return-Path: <sieve-mailing-list@diversity.nl>
X-Original-To: sieve@ietfa.amsl.com
Delivered-To: sieve@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 878EBC13C232 for <sieve@ietfa.amsl.com>; Fri, 29 Jul 2022 07:33:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.11
X-Spam-Level:
X-Spam-Status: No, score=-7.11 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=diversity.nl
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CI5aLBCNXChc for <sieve@ietfa.amsl.com>; Fri, 29 Jul 2022 07:33:18 -0700 (PDT)
Received: from box.xn--danils-sva.net (box.xn--danils-sva.net [IPv6:2a01:7e00:e000:5da::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 52520C13CCEA for <sieve@ietf.org>; Fri, 29 Jul 2022 07:33:10 -0700 (PDT)
Received: from authenticated-user (box.xn--danils-sva.net [139.162.220.23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.xn--danils-sva.net (Postfix) with ESMTPSA id 3F5AB40056 for <sieve@ietf.org>; Fri, 29 Jul 2022 16:33:08 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=diversity.nl; s=mail; t=1659105188; bh=/9rOZ35RFtLHvpwh9wxkIhW8WpjodBPTliY6HjAm0wY=; h=Date:From:To:Subject:From; b=hPhNjifYXWv11306XCrp7n7SDNMzwW+uvaSSGz6FT/nFVCBx4bwkRW4q50hVAYGLr FQ8kHCMRw5nI6ott/tgkWj38xlZGSLDw1Vp23RhartF8M/I4xN4hWoFqDwH+7JD0BE wL7AV1e2evI7xyQu6225Xk4bafj0KxECIlb3SD8Vk4lFyCb0aawR3W3A6Y2asuWt5o vfS7LtCcDjXx7bbIJ+pO3VlA9hywOrIHhj7/AwVdkNM5H5p3tUUDEP9DcJPMUkFx2b PP8ZRg3yxDIX3imCgOziHFfeQAgCtQ38Y83YY7GM/Prp2QXGjgIQY1VVMc+WpUWsUK EklZ0itJnhkOg==
MIME-Version: 1.0
Date: Fri, 29 Jul 2022 16:33:08 +0200
From: sieve-mailing-list@diversity.nl
To: sieve@ietf.org
Message-ID: <26b57cc8f5439281a79f7026e9753793@diversity.nl>
X-Sender: sieve-mailing-list@diversity.nl
Content-Type: text/plain; charset="US-ASCII"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/sieve/g6iBoNQojyPq6-FHT4SixZpLB3w>
Subject: [sieve] sieve not working on mail in a box
X-BeenThere: sieve@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: SIEVE Working Group <sieve.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sieve>, <mailto:sieve-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/sieve/>
List-Post: <mailto:sieve@ietf.org>
List-Help: <mailto:sieve-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sieve>, <mailto:sieve-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jul 2022 15:03:16 -0000

Please forgive me if this is not the correct mailing list.
I tried days ago on the mail in a box forum but my question falls on 
deaf ears there.

I am mailing here in the tiny chance the issue is sieve related.

Please consider the following sieve filter

--------------
# rule:[discard SPAM to old leaked/compromised aliases]
if header :contains ["Received", "To"]
[
	"me@mymiab.net"
	,"other_me@mymiab.net"
]
{
	discard;
}
--------------

when testing it using the sieve filter found here
https://www.fastmail.com/cgi-bin/sievetest.pl

using the following headers


--------------
Return-Path: <postrl@thetoyscollective.com>
Delivered-To: me@mymiab.net
Received: from box.mymiab.net ([127.0.0.1])
     by box.mymiab.net with LMTP id cJdVEakZ4WJEPwAAs4i54A
     for <me@mymiab.net>; Wed, 27 Jul 2022 12:55:37 +0200
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
     box.mymiab.net
X-Spam-Flag: YES
X-Spam-Level: ********
X-Spam-Status: Yes, score=8.3 required=5.0 
tests=DATE_IN_PAST_03_06,DMARC_NONE,
     FSL_BULK_SIG,HTML_IMAGE_RATIO_06,HTML_MESSAGE,MIME_HTML_ONLY,
     PYZOR_CHECK,SPF_FAIL,SPF_HELO_NEUTRAL autolearn=no 
autolearn_force=no
     version=3.4.2
X-Spam-Report:
     * 5.0 SPF_FAIL SPF check failed
     * 0.1 DMARC_NONE DMARC record not found
     * 1.1 DATE_IN_PAST_03_06 Date: is 3 to 6 hours before Received: date
     * 0.0 SPF_HELO_NEUTRAL SPF: HELO does not match SPF record (neutral)
     * 0.0 HTML_MESSAGE BODY: HTML included in message
     * 0.1 MIME_HTML_ONLY BODY: Message only has text/html MIME parts
     * 0.0 HTML_IMAGE_RATIO_06 BODY: HTML has a low ratio of text to 
image
     * area
     * 2.0 PYZOR_CHECK Listed in Pyzor
     * (https://pyzor.readthedocs.io/en/latest/)
     * 0.0 FSL_BULK_SIG Bulk signature with no Unsubscribe
X-Spam-Score: 8.3
X-Greylist: delayed 3601 seconds by postgrey-1.36 at box.mymiab.net; 
Wed, 27 Jul 2022 12:55:34 CEST
Authentication-Results: box.mymiab.net; dmarc=none (p=none dis=none) 
header.from=schnellerversand.com
Authentication-Results: box.mymiab.net; spf=fail 
smtp.mailfrom=postrl@thetoyscollective.com
Authentication-Results: box.mymiab.net; dkim=none;
     dkim-atps=neutral
Received: from skullandbonesskateboards.com (pp9p.com [69.12.64.248])
     by box.mymiab.net (Postfix) with ESMTP id F2FC640018
     for <a@c.d>; Wed, 27 Jul 2022 12:55:34 +0200 (CEST)
To: a@c.d
Subject: Jahrelange Garantie auf unser Set >> Zwei z. Preis von einem
Message-ID: <4909f1a30f80cf882d8d65ae3d357810@greenworkstools.com>
Date: Wed, 27 Jul 2022 07:32:04 +0200
 From: "Deutsche Werkzeughandel" <post@schnellerversand.com>
Reply-To: post@schnellerversand.com
MIME-Version: 1.0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 8bit
--------------



the result is

///
Adding ending newline to email
discarding message
///


Great, the filter looks like it is constructed correctly. So it should 
be working.

However the emails still end up either in my inbox, when not marked as 
SPAM. Or end up in my SPAM box. Both should not happen.

It there anything I can do to pinpoint where things are going wrong?

The reasoning for looking in both Received and To headers is because 
sometimes I am getting SPAM via a BCC. So then the To header does not 
contain anything related to the filter. But the Received always does so 
theoretically I should be able to only use the Received header but that 
also does not work ;(


Could anyone please advice me on how to proceed getting to the bottom of 
this?