]> source.dussan.org Git - rspamd.git/commitdiff
[Test] WHITELIST_SPF_DKIM 3030/head
authorkorgoth1 <vladislav.stakhov@gmail.com>
Tue, 3 Sep 2019 17:50:07 +0000 (20:50 +0300)
committerkorgoth1 <vladislav.stakhov@gmail.com>
Tue, 3 Sep 2019 17:50:07 +0000 (20:50 +0300)
test/functional/cases/123_whitelist.robot
test/functional/configs/whitelist.conf
test/functional/messages/dmarc/no_dkim_valid_spf.eml [new file with mode: 0644]

index 570c43bf86d9f6f0d84fc3d4f1daae71c34756f8..07eb848cf912ee59e52cd09102b2bb7f8499c921 100644 (file)
@@ -12,6 +12,7 @@ ${M_DMARC_BAD}  ${TESTDIR}/messages/dmarc/fail_none.eml
 
 ${M_DKIM_RSPAMD_OK}   ${TESTDIR}/messages/dmarc/good_dkim_rspamd.eml
 ${M_DKIM_RSPAMD_BAD}  ${TESTDIR}/messages/dmarc/bad_dkim_rspamd.eml
+${M_NO_DKIM_VALID_SPF}  ${TESTDIR}/messages/dmarc/no_dkim_valid_spf.eml
 
 ${UTF_MESSAGE}  ${TESTDIR}/messages/utf.eml
 ${RSPAMD_SCOPE}  Suite
@@ -60,6 +61,27 @@ BLACKLISTS_WL_ONLY
   Should Not Contain  ${result.stdout}  WHITELIST_DKIM (
   Should Not Contain  ${result.stdout}  BLACKLIST_DKIM (
 
+VALID SPF and VALID DKIM
+  ${result} =  Scan Message With Rspamc  ${M_DKIM_RSPAMD_OK}
+  Should Contain  ${result.stdout}  R_SPF_ALLOW (
+  Should Contain  ${result.stdout}  R_DKIM_ALLOW (
+  Should Contain  ${result.stdout}  WHITELIST_SPF_DKIM (
+
+VALID SPF and NOT VALID DKIM
+  ${result} =  Scan Message With Rspamc  ${M_DKIM_RSPAMD_BAD}
+  Should Contain  ${result.stdout}  R_SPF_ALLOW (
+  Should Contain  ${result.stdout}  R_DKIM_REJECT (
+  Should Not Contain  ${result.stdout}  WHITELIST_SPF_DKIM (
+  Should Not Contain  ${result.stdout}  R_DKIM_ALLOW (
+
+VALID SPF and NO DKIM
+  ${result} =  Scan Message With Rspamc  ${M_NO_DKIM_VALID_SPF}
+  Should Contain  ${result.stdout}  R_SPF_ALLOW (
+  Should Contain  ${result.stdout}  R_DKIM_NA (
+  Should Not Contain  ${result.stdout}  R_DKIM_REJECT (
+  Should Not Contain  ${result.stdout}  WHITELIST_SPF_DKIM (
+  Should Not Contain  ${result.stdout}  R_DKIM_ALLOW (
+  
 *** Keywords ***
 Whitelist Setup
   ${PLUGIN_CONFIG} =  Get File  ${TESTDIR}/configs/whitelist.conf
index 7769f5cd42cd8779bfe3b4507c73c87f4de2d2e6..29df415ab690aa3e8d176a9d4c11058e3843991a 100644 (file)
@@ -36,6 +36,17 @@ whitelist {
             inverse_symbol = "BLACKLIST_SPF";
         }
 
+        "WHITELIST_SPF_DKIM" = {
+            valid_spf = true;
+            valid_dkim = true;
+            domains = [
+                "${TESTDIR}/configs/maps/domains.list"
+            ];
+            score = -3.0;
+            description = "Mail comes from the whitelisted domain and has a valid SPF policy and valid DKIM signature";
+        }
+
+
         "WHITELIST_DMARC_DKIM" = {
             valid_dmarc = true;
             valid_dkim = true;
diff --git a/test/functional/messages/dmarc/no_dkim_valid_spf.eml b/test/functional/messages/dmarc/no_dkim_valid_spf.eml
new file mode 100644 (file)
index 0000000..2ed5a9d
--- /dev/null
@@ -0,0 +1,48 @@
+Delivered-To: vstakhov@gmail.com
+Received: by 2002:a6b:e610:0:0:0:0:0 with SMTP id g16-v6csp2201135ioh;
+        Mon, 1 Oct 2018 07:27:55 -0700 (PDT)
+X-Google-Smtp-Source: ACcGV6270qkcKzPIvBSxvaIpBZbNAdj6Qp7qqenTBQi6YaUXdBFD2+2ZYmZaw2WM/SxZP2kYTIz2
+X-Received: by 2002:adf:93e6:: with SMTP id 93-v6mr1901854wrp.81.1538404075350;
+        Mon, 01 Oct 2018 07:27:55 -0700 (PDT)
+ARC-Seal: i=1; a=rsa-sha256; t=1538404075; cv=none;
+        d=google.com; s=arc-20160816;
+        b=RaCtnaDmStierMmg+OOhEkzaXxQVAcFO/Rc/ey+6INIQJx+lKVO+dWT0qNA7cZcwUm
+         my6bQE0AZNf45s3bVmQeECtvfe2yS7zVSRx1HFTJJ+iiNR9iSvC8j5PUz1VShRez9Csm
+         4tqy1ic5t0t9NoOL24f82ju5gTbpl0cc7aH9sMn8gr4DwBxnvuJu4+EdP1QcDKE9qTVa
+         QpjOOOpnkmA46PypufkX+ENaq+bfNDpgbAppKfz2rmutF49jouF8XkrB9Z2ZRWPHE4YA
+         gHJ78GT/4NPlFNo95Ik/nDdnUI6gHkTmiSS6aDJh1W5MiXbkuLT8DSa4Htc43nIr2/m6
+         uQ7g==
+ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
+        h=content-transfer-encoding:content-language:mime-version:user-agent
+         :date:message-id:autocrypt:openpgp:to:subject:from:dkim-signature;
+        bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=;
+        b=utFz5J7XQOwR6hdXC0uF+PX17r57baD9GXm5v+3ztobSCFAI0ex+psgbX2gBo6izq3
+         Vo/QjJ9SeJEYhTsLR7jZ3o5meWXJZJqRH073eZlisUGOnDJkJQ5aN/4DY0L5btqLYhwI
+         mJ7c3g4Uh9zFNK8eSIDLdLAIPXNXWRT3SvoS4Ck9ok7fivfZzNfKIPUXbQFIql4+vIAj
+         t1v47QwIrTU+ojwBfaaDjtQEnOB2t8c7RNXys+LQFawG6QZGmG8PCrkVZTU+1v23qbUb
+         M7kDhvSISDchgSrHFwSIniXnnqZe6MRm24xlfW5yebFgmjzMCZQLiyA+WuMIUVxDJpKO
+         V/6g==
+ARC-Authentication-Results: i=1; mx.google.com;
+       dkim=pass header.i=@rspamd.com header.s=dkim header.b=iuniqXuF;
+       spf=pass (google.com: domain of vsevolod@rspamd.com designates 88.99.142.95 as permitted sender) smtp.mailfrom=vsevolod@rspamd.com
+Return-Path: <vsevolod@rspamd.com>
+Received: from mail.highsecure.ru (mail.highsecure.ru. [88.99.142.95])
+        by mx.google.com with ESMTPS id u13-v6si8362844wmd.167.2018.10.01.07.27.54
+        for <vstakhov@gmail.com>
+        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
+        Mon, 01 Oct 2018 07:27:55 -0700 (PDT)
+Received-SPF: pass (google.com: domain of vsevolod@rspamd.com designates 88.99.142.95 as permitted sender) client-ip=88.99.142.95;
+From: Vsevolod Stakhov <vsevolod@rspamd.com>
+Subject: test
+To: vstakhov@gmail.com
+Message-ID: <6f4415bf-ff61-f0f5-b60c-ba71a56b9e48@rspamd.com>
+Date: Mon, 1 Oct 2018 15:27:53 +0100
+User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0)
+ Gecko/20100101 Thunderbird/52.9.1
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Language: en-US
+Content-Transfer-Encoding: 7bit
+Authentication-Results: mail.highsecure.ru;
+       auth=pass smtp.auth=vsevolod@highsecure.ru smtp.mailfrom=vsevolod@rspamd.com
+