Hello!

I'm trying to get a complex header_check to work, and unfortunately it
isn't. :(  I started in #postfix and figured I would follow up here too.

The goal is to put mail on HOLD if it is not spam and is destined for 2
role accounts.  Any help is much appreciated.


~$ cat header_checks.pcre
if /^X-Spam-Status: No/
/^To:.*admin@/                          HOLD
/^To:.*owner@/                          HOLD
endif


~$ postmap -vhmq - pcre:header_checks.pcre < test.eml 
postmap: name_mask: ipv4
postmap: name_mask: ipv6
postmap: inet_addr_local: configured 2 IPv4 addresses
postmap: inet_addr_local: configured 3 IPv6 addresses
postmap: dict_open: pcre:header_checks.pcre
postmap: dict_pcre_lookup: header_checks.pcre: Return-Path: 
<nob...@othertest.com>
postmap: dict_pcre_lookup: header_checks.pcre: Message-ID: 
<d9da2469.49220...@test.com>
postmap: dict_pcre_lookup: header_checks.pcre: Date: Tue, 18 Jan 2022 00:23:06 
+0900
postmap: dict_pcre_lookup: header_checks.pcre: From: Nobody 
<nob...@othertest.com>
postmap: dict_pcre_lookup: header_checks.pcre: Mime-Version: 1.0
postmap: dict_pcre_lookup: header_checks.pcre: To: Test Admin <ad...@test.com>
postmap: dict_pcre_lookup: header_checks.pcre: Subject: BEST TEST for the BEST 
TEST Admin
postmap: header_token: multipart / alternative
postmap: header_token: boundary = ===============1daff0b5e974181ee018f94c==
postmap: PUSH boundary ===============1daff0b5e974181ee018f94c==
postmap: dict_pcre_lookup: header_checks.pcre: Content-Type: 
multipart/alternative;? boundary="===============1daff0b5e974181ee018f94c=="
postmap: dict_pcre_lookup: header_checks.pcre: X-Virus-Scanned: clamav-milter 
0.103.3 at mx1.domainmail.net
postmap: dict_pcre_lookup: header_checks.pcre: X-Virus-Status: Clean
postmap: dict_pcre_lookup: header_checks.pcre: X-Spam-Status: No, score=3.0 
required=5.0 tests=HTML_FONT_LOW_CONTRAST,?        
HTML_MESSAGE,MIME_QP_LONG_LINE,URIBL_ABUSE_SURBL,URIBL_SBL_A?        
shortcircuit=no autolearn=disabled version=3.4.6
postmap: dict_pcre_lookup: header_checks.pcre: X-Spam-Level: ***
postmap: dict_pcre_lookup: header_checks.pcre: X-Spam-Checker-Version: 
SpamAssassin 3.4.6 (2021-04-09) on? mx1.domainmail.net
postmap: POP boundary ===============1daff0b5e974181ee018f94c==



~$ cat test.eml
eturn-Path: <nob...@othertest.com>
Message-ID: <d9da2469.49220...@test.com>
Date: Tue, 18 Jan 2022 00:23:06 +0900
From: Nobody <nob...@othertest.com>
Mime-Version: 1.0
To: Test Admin <ad...@test.com>
Subject: BEST TEST for the BEST TEST Admin
Content-Type: multipart/alternative;
 boundary="===============1daff0b5e974181ee018f94c=="
X-Virus-Scanned: clamav-milter 0.103.3 at mx1.domainmail.net
X-Virus-Status: Clean
X-Spam-Status: No, score=3.0 required=5.0 tests=HTML_FONT_LOW_CONTRAST,
        HTML_MESSAGE,MIME_QP_LONG_LINE,URIBL_ABUSE_SURBL,URIBL_SBL_A
        shortcircuit=no autolearn=disabled version=3.4.6
X-Spam-Level: ***
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
 mx1.domainmail.net

This is a test message




Reply via email to