From 003aefeb8f991725cd2ba4e229f135fde86931d0 Mon Sep 17 00:00:00 2001 From: korgoth1 Date: Fri, 1 May 2020 15:51:21 +0300 Subject: [PATCH] [TEST] Some rules + FROM_NEQ_ENVFROM --- test/functional/cases/280_rules.robot | 20 +++++++++++++ test/functional/messages/btc.eml | 33 ++++++++++++++++++++++ test/functional/messages/rcvd7.eml | 34 +++++++++++++++++++++++ test/functional/messages/yand_forward.eml | 31 +++++++++++++++++++++ 4 files changed, 118 insertions(+) create mode 100644 test/functional/messages/btc.eml create mode 100644 test/functional/messages/rcvd7.eml create mode 100644 test/functional/messages/yand_forward.eml diff --git a/test/functional/cases/280_rules.robot b/test/functional/cases/280_rules.robot index b6b347313..9067084b5 100644 --- a/test/functional/cases/280_rules.robot +++ b/test/functional/cases/280_rules.robot @@ -55,6 +55,26 @@ PDF javascript ${result} = Scan Message With Rspamc ${MESSAGE7} Check Rspamc ${result} PDF_JAVASCRIPT +BITCOIN ADDR + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/btc.eml + Should Contain ${result.stdout} BITCOIN_ADDR + +RCVD_COUNT_ONE + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/btc.eml + Should Contain ${result.stdout} RCVD_COUNT_ONE + +RCVD_COUNT_FIVE + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/yand_forward.eml + Should Contain ${result.stdout} RCVD_COUNT_FIVE + +RCVD_COUNT_SEVEN + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/rcvd7.eml + Should Contain ${result.stdout} RCVD_COUNT_SEVEN + +FROM_NEQ_ENVFROM + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/yand_forward.eml + Should Contain ${result.stdout} FROM_NEQ_ENVFROM + *** Keywords *** Rules Setup diff --git a/test/functional/messages/btc.eml b/test/functional/messages/btc.eml new file mode 100644 index 000000000..d1df8e0c1 --- /dev/null +++ b/test/functional/messages/btc.eml @@ -0,0 +1,33 @@ +Received: by mail-lf1-f54.google.com with SMTP id j14so14439709lfg.9 + for ; Mon, 27 Apr 2020 09:54:21 -0700 (PDT) +From: test@test.com +Date: Mon, 27 Apr 2020 19:54:10 +0300 +Message-ID: +Subject: Fwd: +To: +Content-Type: multipart/alternative; boundary="00000000000004de7805a4489190" + +--0000000000004bee6805a4484c02 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: base64 + +1EHbEvWFk +R3oY93EKym1bweaWUW2PKe6v9 + +--0000000000004bee6805a4484c02 +Content-Type: text/html; charset="UTF-8" +Content-Transfer-Encoding: quoted-printable + +


---------- Forwarded message ---------
=D0=9E=D1=82: =D0=92=D0=BB=D0=B0=D0=B4=D0=B8= +=D1=81=D0=BB=D0=B0=D0=B2 <test@test.ru>
= +Date: =D0=BF=D0=BD, 27 =D0=B0=D0=BF=D1=80. 2020 =D0=B3. =D0=B2 19:34
Sub= +ject:
To: =D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2 =D0=A1= +=D1=82=D0=B0=D1=85=D0=BE=D0=B2 <test@test.ru>


1EHbEvWFkR3oY93EKym1bweaWUW2PKe6v9
+
+ +--0000000000004bee6805a4484c02-- \ No newline at end of file diff --git a/test/functional/messages/rcvd7.eml b/test/functional/messages/rcvd7.eml new file mode 100644 index 000000000..2da00dee8 --- /dev/null +++ b/test/functional/messages/rcvd7.eml @@ -0,0 +1,34 @@ +Return-Path: +Received: from mx7.mail.testler.ru ([] verified) + by mail2006.testler.ru (testlerMail 6.1 SMTP 6.1a7) + with ESMTP id 60578244 for test@test.com; Mon, 27 Apr 2020 19:45:05 +0300 +Received: from forward106p.mail.test.net (forward106p.mail.test.net []) + by mx7.mail.testler.ru (Postfix) with ESMTP id 9B38C6E043A + for ; Mon, 27 Apr 2020 19:45:05 +0300 (MSK) +Received: from forward101p.mail.test.net (forward106p.mail.test.net []) + by mx7.mail.testler.ru (Postfix) with ESMTP id 9B38C6E043A + for ; Mon, 27 Apr 2020 19:45:05 +0300 (MSK) +Received: from forward100p.mail.test.net (forward106p.mail.test.net []) + by mx7.mail.testler.ru (Postfix) with ESMTP id 9B38C6E043A + for ; Mon, 27 Apr 2020 19:45:05 +0300 (MSK) +Received: from forward106p.mail.test.net (forward106p.mail.test.net []) + by resmtp2.mail.testler.ru (resmtp/testler) with ESMTP id j51GAaUB; + Mon, 27 Apr 2020 16:45:05 +0000 +Received: from forward102q.mail.test.net (forward102q.mail.test.net []) + by forward106p.mail.test.net (test) with ESMTP id 71D441C81C0C + for ; Mon, 27 Apr 2020 19:45:05 +0300 (MSK) +Received: from mxback10q.mail.test.net (mxback10q.mail.test.net []) + by forward102q.mail.test.net (test) with ESMTP id 6E2CA7F20010 + for ; Mon, 27 Apr 2020 19:45:05 +0300 (MSK) +From: test@test.ru +Envelope-From: test@test.ru +To: , + +In-Reply-To: <878111588005719@mail.test.ru> +Subject: Fwd: 123 +MIME-Version: 1.0 +X-Mailer: test [ http://test.ru ] 5.0 +Date: Mon, 27 Apr 2020 19:45:05 +0300 +Message-Id: <906211588005891@mail.test.ru> +Content-Type: text/html; charset=utf-8 +Content-Transfer-Encoding: quoted-printable \ No newline at end of file diff --git a/test/functional/messages/yand_forward.eml b/test/functional/messages/yand_forward.eml new file mode 100644 index 000000000..b95309f33 --- /dev/null +++ b/test/functional/messages/yand_forward.eml @@ -0,0 +1,31 @@ +Return-Path: +Received: from mx7.test.ru ([0.0.0.0] verified) + by mail.test.ru (test mail) + with ESMTP id 60578244 + (envelope-from ) + for test@test.ru; Mon, 27 Apr 2020 19:45:05 +0300 +Received: from forward106p.test.eu (forward106p.test.eu []) + by mail.test.ru (Postfix) with ESMTP id 9B38C6E043A + (envelope-from ) + for ; Mon, 27 Apr 2020 19:45:05 +0300 (MSK) +Received: from forward106p.test.eu (forward106p.test.eu []) + by test.ru (test) with ESMTP id j51GAaUB; + Mon, 27 Apr 2020 16:45:05 +0000 +Received: from forward102q.test.eu (forward102q.test.eu []) + by forward106p.test.eu (test) with ESMTP id 71D441C81C0C + (envelope-from ) + for ; Mon, 27 Apr 2020 19:45:05 +0300 (MSK) +Received: from mxback10q.test.eu (mxback10q.test.eu []) + by forward102q.test.eu (test) with ESMTP id 6E2CA7F20010 + (envelope-from ) + for ; Mon, 27 Apr 2020 19:45:05 +0300 (MSK) +From: test@test.eu +Envelope-From: test@test.net +To: , + +In-Reply-To: +Subject: Fwd: 123 +MIME-Version: 1.0 +Date: Mon, 27 Apr 2020 19:45:05 +0300 + +lsakdlsa;dk \ No newline at end of file -- 2.39.5