[pmg-devel] [PATCH 2/2] add test case for 'from' and 'to' together

Mira Limbeck m.limbeck at proxmox.com
Fri Apr 24 17:21:50 CEST 2020


Updates the other test outputs' line numbers so the tests don't fail because of
an addition in between.

Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
---
Will separate the input for the different test cases when I refactor the
whole testing to use the functions directly. It is a lot of work to
update the line numbers all the time just because of an addition in
the test_input_mixed file.

 tests/test_input_mixed                       |  9 ++++
 tests/test_output_before_queue               | 57 ++++++++++++--------
 tests/test_output_before_queue_from_to       | 21 ++++++++
 tests/test_output_before_queue_host          | 55 +++++++++++--------
 tests/test_output_before_queue_qid           | 42 +++++++--------
 tests/test_output_before_queue_search_string |  2 +-
 tests/tests_before_queue.rs                  | 25 +++++++++
 7 files changed, 146 insertions(+), 65 deletions(-)
 create mode 100644 tests/test_output_before_queue_from_to

diff --git a/tests/test_input_mixed b/tests/test_input_mixed
index d3ce10d..7a12b37 100644
--- a/tests/test_input_mixed
+++ b/tests/test_input_mixed
@@ -25,6 +25,15 @@ Dec 18 15:08:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: moved mail for <
 Dec 18 15:08:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: processing time: 0.029 seconds (0, 0.009, 0)
 Dec 18 15:08:26 pmg postfix/smtpd[21949]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (381C4E5DFA32622BFC4); from=<mailtestsender3 at localhost.localdomain> to=<pmgtes2 at localhost.localdomain> proto=ESMTP helo=<localhost.localdomain>
 Dec 18 15:08:26 pmg postfix/smtpd[21949]: disconnect from pmg.localhost[192.168.22.40] ehlo=1 mail=1 rcpt=1 data=1 commands=4
+Dec 18 15:10:26 pmg postfix/smtpd[21949]: connect from pmg.localhost[192.168.22.40]
+Dec 18 15:10:26 pmg postfix/smtpd[21949]: NOQUEUE: client=pmg.localhost[192.168.22.40]
+Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 2019/12/18-15:06:26 CONNECT TCP Peer: "[127.0.0.1]:47968" Local: "[127.0.0.1]:10023"
+Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: reloading configuration Proxmox_ruledb
+Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: new mail message-id=<xyz>
+Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: moved mail for <pmgtest at localhost.localdomain> to spam quarantine - 381C675DFA32622FD56 (rule: quarantine all)
+Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: processing time: 0.029 seconds (0, 0.009, 0)
+Dec 18 15:10:26 pmg postfix/smtpd[21949]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (381C4E5DFA32622BFC4); from=<mailtestsender3 at localhost.localdomain> to=<pmgtest at localhost.localdomain> proto=ESMTP helo=<localhost.localdomain>
+Dec 18 15:10:26 pmg postfix/smtpd[21949]: disconnect from pmg.localhost[192.168.22.40] ehlo=1 mail=1 rcpt=1 data=1 commands=4
 Dec 18 15:36:32 proxmox-new postfix/smtpd[29902]: connect from test.localdomain[192.168.22.40]
 Dec 18 15:36:33 proxmox-new postfix/smtpd[29902]: NOQUEUE: client=test.localdomain[192.168.22.40]
 Dec 18 15:36:33 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: new mail message-id=<xyz>#012
diff --git a/tests/test_output_before_queue b/tests/test_output_before_queue
index 46e90dc..70f39e8 100644
--- a/tests/test_output_before_queue
+++ b/tests/test_output_before_queue
@@ -43,6 +43,19 @@ L00000019 Dec 18 15:08:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: proces
 L0000001A Dec 18 15:08:26 pmg postfix/smtpd[21949]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (381C4E5DFA32622BFC4); from=<mailtestsender3 at localhost.localdomain> to=<pmgtes2 at localhost.localdomain> proto=ESMTP helo=<localhost.localdomain>
 L0000001B Dec 18 15:08:26 pmg postfix/smtpd[21949]: disconnect from pmg.localhost[192.168.22.40] ehlo=1 mail=1 rcpt=1 data=1 commands=4
 
+SMTPD: T5FDCC662L00000000
+CTIME: 5FDCC662
+CLIENT: pmg.localhost[192.168.22.40]
+TO:5FDCC662:T5FDCC662L00000000:Q: from <mailtestsender3 at localhost.localdomain> to <pmgtest at localhost.localdomain>
+LOGS:
+L0000001C Dec 18 15:10:26 pmg postfix/smtpd[21949]: connect from pmg.localhost[192.168.22.40]
+L0000001D Dec 18 15:10:26 pmg postfix/smtpd[21949]: NOQUEUE: client=pmg.localhost[192.168.22.40]
+L00000020 Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: new mail message-id=<xyz>
+L00000021 Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: moved mail for <pmgtest at localhost.localdomain> to spam quarantine - 381C675DFA32622FD56 (rule: quarantine all)
+L00000022 Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: processing time: 0.029 seconds (0, 0.009, 0)
+L00000023 Dec 18 15:10:26 pmg postfix/smtpd[21949]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (381C4E5DFA32622BFC4); from=<mailtestsender3 at localhost.localdomain> to=<pmgtest at localhost.localdomain> proto=ESMTP helo=<localhost.localdomain>
+L00000024 Dec 18 15:10:26 pmg postfix/smtpd[21949]: disconnect from pmg.localhost[192.168.22.40] ehlo=1 mail=1 rcpt=1 data=1 commands=4
+
 QENTRY: 1C6B541C5D
 CTIME: 5FDCCD39
 SIZE: 7298
@@ -53,34 +66,34 @@ TO:5FDCCC85:1C6B541C5D:A: from <test at test.localdomain> to <test3 at localhost> (192
 TO:5FDCCC85:1C6B541C5D:A: from <test at test.localdomain> to <test2 at localhost> (192.168.22.40[192.168.22.40]:25)
 TO:5FDCCC85:1C6B541C5D:A: from <test at test.localdomain> to <test1 at localhost> (192.168.22.40[192.168.22.40]:25)
 SMTP:
-L0000001C Dec 18 15:36:32 proxmox-new postfix/smtpd[29902]: connect from test.localdomain[192.168.22.40]
-L0000001D Dec 18 15:36:33 proxmox-new postfix/smtpd[29902]: NOQUEUE: client=test.localdomain[192.168.22.40]
-L00000020 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: connect from localhost.localdomain[127.0.0.1]
-L00000021 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: 1C6B541C5D: client=localhost.localdomain[127.0.0.1], orig_client=test.localdomain[192.168.22.40]
-L00000028 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: disconnect from localhost.localdomain[127.0.0.1] ehlo=1 xforward=1 mail=1 rcpt=4 data=1 commands=8
-L0000002A Dec 18 15:36:37 proxmox-new postfix/smtpd[29902]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (436445DD3BD7D71595); from=<test at test.localdomain> to=<test2 at localhost> proto=ESMTP helo=<vger.kernel.org>
-L00000030 Dec 18 15:39:37 proxmox-new postfix/smtpd[29902]: disconnect from test.localdomain[192.168.22.40] ehlo=1 mail=1 rcpt=4 bdat=1 quit=1 commands=8
+L00000025 Dec 18 15:36:32 proxmox-new postfix/smtpd[29902]: connect from test.localdomain[192.168.22.40]
+L00000026 Dec 18 15:36:33 proxmox-new postfix/smtpd[29902]: NOQUEUE: client=test.localdomain[192.168.22.40]
+L00000029 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: connect from localhost.localdomain[127.0.0.1]
+L0000002A Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: 1C6B541C5D: client=localhost.localdomain[127.0.0.1], orig_client=test.localdomain[192.168.22.40]
+L00000031 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: disconnect from localhost.localdomain[127.0.0.1] ehlo=1 xforward=1 mail=1 rcpt=4 data=1 commands=8
+L00000033 Dec 18 15:36:37 proxmox-new postfix/smtpd[29902]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (436445DD3BD7D71595); from=<test at test.localdomain> to=<test2 at localhost> proto=ESMTP helo=<vger.kernel.org>
+L00000039 Dec 18 15:39:37 proxmox-new postfix/smtpd[29902]: disconnect from test.localdomain[192.168.22.40] ehlo=1 mail=1 rcpt=4 bdat=1 quit=1 commands=8
 FILTER: 436445DD3BD7D71595
-L0000001E Dec 18 15:36:33 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: new mail message-id=<xyz>#012
-L0000001F Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: SA score=0/5 time=3.611 bayes=undefined autolearn=disabled hits=DKIMWL_WL_HIGH(-0.001),DKIM_SIGNED(0.1),DKIM_VALID(-0.1),DKIM_VALID_AU(-0.1),DKIM_VALID_EF(-0.1),MAILING_LIST_MULTI(-1),RCVD_IN_DNSWL_HI(-5),SPF_HELO_NONE(0.001),SPF_NONE(0.001)
-L00000024 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test2 at localhost> (1C6B541C5D) (rule: default-accept)
-L00000025 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test3 at localhost> (1C6B541C5D) (rule: default-accept)
-L00000026 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test4 at localhost> (1C6B541C5D) (rule: default-accept)
-L00000027 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test1 at localhost> (1C6B541C5D) (rule: default-accept)
-L00000029 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: processing time: 3.701 seconds (3.611, 0.021, 0)
+L00000027 Dec 18 15:36:33 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: new mail message-id=<xyz>#012
+L00000028 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: SA score=0/5 time=3.611 bayes=undefined autolearn=disabled hits=DKIMWL_WL_HIGH(-0.001),DKIM_SIGNED(0.1),DKIM_VALID(-0.1),DKIM_VALID_AU(-0.1),DKIM_VALID_EF(-0.1),MAILING_LIST_MULTI(-1),RCVD_IN_DNSWL_HI(-5),SPF_HELO_NONE(0.001),SPF_NONE(0.001)
+L0000002D Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test2 at localhost> (1C6B541C5D) (rule: default-accept)
+L0000002E Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test3 at localhost> (1C6B541C5D) (rule: default-accept)
+L0000002F Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test4 at localhost> (1C6B541C5D) (rule: default-accept)
+L00000030 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test1 at localhost> (1C6B541C5D) (rule: default-accept)
+L00000032 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: processing time: 3.701 seconds (3.611, 0.021, 0)
 QMGR:
-L00000022 Dec 18 15:36:37 proxmox-new postfix/cleanup[29714]: 1C6B541C5D: message-id=<xyz>
-L00000023 Dec 18 15:36:37 proxmox-new postfix/qmgr[6194]: 1C6B541C5D: from=<test at test.localdomain>, size=7298, nrcpt=4 (queue active)
-L0000002B Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test1 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
-L0000002C Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test2 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
-L0000002D Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test3 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
-L0000002E Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test4 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
-L0000002F Dec 18 15:36:37 proxmox-new postfix/qmgr[6194]: 1C6B541C5D: removed
+L0000002B Dec 18 15:36:37 proxmox-new postfix/cleanup[29714]: 1C6B541C5D: message-id=<xyz>
+L0000002C Dec 18 15:36:37 proxmox-new postfix/qmgr[6194]: 1C6B541C5D: from=<test at test.localdomain>, size=7298, nrcpt=4 (queue active)
+L00000034 Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test1 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
+L00000035 Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test2 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
+L00000036 Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test3 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
+L00000037 Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test4 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
+L00000038 Dec 18 15:36:37 proxmox-new postfix/qmgr[6194]: 1C6B541C5D: removed
 
 SMTPD: T5FDCCD46L00000000
 CTIME: 5FDCCD46
 CLIENT: 10.0.0.1
 TO:5FDCCD46:T5FDCCD46L00000000:N: from <rbl_reject_test at localhost.localdomain> to <test at reject.localhost.localdomain>
 LOGS:
-L00000031 Dec 18 15:39:50 proxmox-new postfix/postscreen[32700]: NOQUEUE: reject: RCPT from [10.0.0.1]:34453: 550 5.7.1 Service unavailable; client [10.0.0.1] blocked using zen.spamhaus.org; from=<rbl_reject_test at localhost.localdomain>, to=<test at reject.localhost.localdomain>, proto=ESMTP, helo=<localhost.localdomain>
+L0000003A Dec 18 15:39:50 proxmox-new postfix/postscreen[32700]: NOQUEUE: reject: RCPT from [10.0.0.1]:34453: 550 5.7.1 Service unavailable; client [10.0.0.1] blocked using zen.spamhaus.org; from=<rbl_reject_test at localhost.localdomain>, to=<test at reject.localhost.localdomain>, proto=ESMTP, helo=<localhost.localdomain>
 
diff --git a/tests/test_output_before_queue_from_to b/tests/test_output_before_queue_from_to
new file mode 100644
index 0000000..610bf34
--- /dev/null
+++ b/tests/test_output_before_queue_from_to
@@ -0,0 +1,21 @@
+# LogReader: 28928
+# Query options
+# Sender: mailtestsender3
+# Recipient: pmgtest
+# Start: 2020-12-18 15:00:00 (1608303600)
+# End: 2020-12-18 15:40:00 (1608306000)
+# End Query Options
+
+SMTPD: T5FDCC662L00000000
+CTIME: 5FDCC662
+CLIENT: pmg.localhost[192.168.22.40]
+TO:5FDCC662:T5FDCC662L00000000:Q: from <mailtestsender3 at localhost.localdomain> to <pmgtest at localhost.localdomain>
+LOGS:
+L0000001C Dec 18 15:10:26 pmg postfix/smtpd[21949]: connect from pmg.localhost[192.168.22.40]
+L0000001D Dec 18 15:10:26 pmg postfix/smtpd[21949]: NOQUEUE: client=pmg.localhost[192.168.22.40]
+L00000020 Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: new mail message-id=<xyz>
+L00000021 Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: moved mail for <pmgtest at localhost.localdomain> to spam quarantine - 381C675DFA32622FD56 (rule: quarantine all)
+L00000022 Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: processing time: 0.029 seconds (0, 0.009, 0)
+L00000023 Dec 18 15:10:26 pmg postfix/smtpd[21949]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (381C4E5DFA32622BFC4); from=<mailtestsender3 at localhost.localdomain> to=<pmgtest at localhost.localdomain> proto=ESMTP helo=<localhost.localdomain>
+L00000024 Dec 18 15:10:26 pmg postfix/smtpd[21949]: disconnect from pmg.localhost[192.168.22.40] ehlo=1 mail=1 rcpt=1 data=1 commands=4
+
diff --git a/tests/test_output_before_queue_host b/tests/test_output_before_queue_host
index 31d70bf..5b47485 100644
--- a/tests/test_output_before_queue_host
+++ b/tests/test_output_before_queue_host
@@ -44,6 +44,19 @@ L00000019 Dec 18 15:08:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: proces
 L0000001A Dec 18 15:08:26 pmg postfix/smtpd[21949]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (381C4E5DFA32622BFC4); from=<mailtestsender3 at localhost.localdomain> to=<pmgtes2 at localhost.localdomain> proto=ESMTP helo=<localhost.localdomain>
 L0000001B Dec 18 15:08:26 pmg postfix/smtpd[21949]: disconnect from pmg.localhost[192.168.22.40] ehlo=1 mail=1 rcpt=1 data=1 commands=4
 
+SMTPD: T5FDCC662L00000000
+CTIME: 5FDCC662
+CLIENT: pmg.localhost[192.168.22.40]
+TO:5FDCC662:T5FDCC662L00000000:Q: from <mailtestsender3 at localhost.localdomain> to <pmgtest at localhost.localdomain>
+LOGS:
+L0000001C Dec 18 15:10:26 pmg postfix/smtpd[21949]: connect from pmg.localhost[192.168.22.40]
+L0000001D Dec 18 15:10:26 pmg postfix/smtpd[21949]: NOQUEUE: client=pmg.localhost[192.168.22.40]
+L00000020 Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: new mail message-id=<xyz>
+L00000021 Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: moved mail for <pmgtest at localhost.localdomain> to spam quarantine - 381C675DFA32622FD56 (rule: quarantine all)
+L00000022 Dec 18 15:10:26 pmg pmg-smtp-filter[1564]: 381C4E5DFA32622BFC4: processing time: 0.029 seconds (0, 0.009, 0)
+L00000023 Dec 18 15:10:26 pmg postfix/smtpd[21949]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (381C4E5DFA32622BFC4); from=<mailtestsender3 at localhost.localdomain> to=<pmgtest at localhost.localdomain> proto=ESMTP helo=<localhost.localdomain>
+L00000024 Dec 18 15:10:26 pmg postfix/smtpd[21949]: disconnect from pmg.localhost[192.168.22.40] ehlo=1 mail=1 rcpt=1 data=1 commands=4
+
 QENTRY: 1C6B541C5D
 CTIME: 5FDCCD39
 SIZE: 7298
@@ -54,27 +67,27 @@ TO:5FDCCC85:1C6B541C5D:A: from <test at test.localdomain> to <test3 at localhost> (192
 TO:5FDCCC85:1C6B541C5D:A: from <test at test.localdomain> to <test2 at localhost> (192.168.22.40[192.168.22.40]:25)
 TO:5FDCCC85:1C6B541C5D:A: from <test at test.localdomain> to <test1 at localhost> (192.168.22.40[192.168.22.40]:25)
 SMTP:
-L0000001C Dec 18 15:36:32 proxmox-new postfix/smtpd[29902]: connect from test.localdomain[192.168.22.40]
-L0000001D Dec 18 15:36:33 proxmox-new postfix/smtpd[29902]: NOQUEUE: client=test.localdomain[192.168.22.40]
-L00000020 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: connect from localhost.localdomain[127.0.0.1]
-L00000021 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: 1C6B541C5D: client=localhost.localdomain[127.0.0.1], orig_client=test.localdomain[192.168.22.40]
-L00000028 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: disconnect from localhost.localdomain[127.0.0.1] ehlo=1 xforward=1 mail=1 rcpt=4 data=1 commands=8
-L0000002A Dec 18 15:36:37 proxmox-new postfix/smtpd[29902]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (436445DD3BD7D71595); from=<test at test.localdomain> to=<test2 at localhost> proto=ESMTP helo=<vger.kernel.org>
-L00000030 Dec 18 15:39:37 proxmox-new postfix/smtpd[29902]: disconnect from test.localdomain[192.168.22.40] ehlo=1 mail=1 rcpt=4 bdat=1 quit=1 commands=8
+L00000025 Dec 18 15:36:32 proxmox-new postfix/smtpd[29902]: connect from test.localdomain[192.168.22.40]
+L00000026 Dec 18 15:36:33 proxmox-new postfix/smtpd[29902]: NOQUEUE: client=test.localdomain[192.168.22.40]
+L00000029 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: connect from localhost.localdomain[127.0.0.1]
+L0000002A Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: 1C6B541C5D: client=localhost.localdomain[127.0.0.1], orig_client=test.localdomain[192.168.22.40]
+L00000031 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: disconnect from localhost.localdomain[127.0.0.1] ehlo=1 xforward=1 mail=1 rcpt=4 data=1 commands=8
+L00000033 Dec 18 15:36:37 proxmox-new postfix/smtpd[29902]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (436445DD3BD7D71595); from=<test at test.localdomain> to=<test2 at localhost> proto=ESMTP helo=<vger.kernel.org>
+L00000039 Dec 18 15:39:37 proxmox-new postfix/smtpd[29902]: disconnect from test.localdomain[192.168.22.40] ehlo=1 mail=1 rcpt=4 bdat=1 quit=1 commands=8
 FILTER: 436445DD3BD7D71595
-L0000001E Dec 18 15:36:33 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: new mail message-id=<xyz>#012
-L0000001F Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: SA score=0/5 time=3.611 bayes=undefined autolearn=disabled hits=DKIMWL_WL_HIGH(-0.001),DKIM_SIGNED(0.1),DKIM_VALID(-0.1),DKIM_VALID_AU(-0.1),DKIM_VALID_EF(-0.1),MAILING_LIST_MULTI(-1),RCVD_IN_DNSWL_HI(-5),SPF_HELO_NONE(0.001),SPF_NONE(0.001)
-L00000024 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test2 at localhost> (1C6B541C5D) (rule: default-accept)
-L00000025 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test3 at localhost> (1C6B541C5D) (rule: default-accept)
-L00000026 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test4 at localhost> (1C6B541C5D) (rule: default-accept)
-L00000027 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test1 at localhost> (1C6B541C5D) (rule: default-accept)
-L00000029 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: processing time: 3.701 seconds (3.611, 0.021, 0)
+L00000027 Dec 18 15:36:33 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: new mail message-id=<xyz>#012
+L00000028 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: SA score=0/5 time=3.611 bayes=undefined autolearn=disabled hits=DKIMWL_WL_HIGH(-0.001),DKIM_SIGNED(0.1),DKIM_VALID(-0.1),DKIM_VALID_AU(-0.1),DKIM_VALID_EF(-0.1),MAILING_LIST_MULTI(-1),RCVD_IN_DNSWL_HI(-5),SPF_HELO_NONE(0.001),SPF_NONE(0.001)
+L0000002D Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test2 at localhost> (1C6B541C5D) (rule: default-accept)
+L0000002E Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test3 at localhost> (1C6B541C5D) (rule: default-accept)
+L0000002F Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test4 at localhost> (1C6B541C5D) (rule: default-accept)
+L00000030 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test1 at localhost> (1C6B541C5D) (rule: default-accept)
+L00000032 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: processing time: 3.701 seconds (3.611, 0.021, 0)
 QMGR:
-L00000022 Dec 18 15:36:37 proxmox-new postfix/cleanup[29714]: 1C6B541C5D: message-id=<xyz>
-L00000023 Dec 18 15:36:37 proxmox-new postfix/qmgr[6194]: 1C6B541C5D: from=<test at test.localdomain>, size=7298, nrcpt=4 (queue active)
-L0000002B Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test1 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
-L0000002C Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test2 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
-L0000002D Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test3 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
-L0000002E Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test4 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
-L0000002F Dec 18 15:36:37 proxmox-new postfix/qmgr[6194]: 1C6B541C5D: removed
+L0000002B Dec 18 15:36:37 proxmox-new postfix/cleanup[29714]: 1C6B541C5D: message-id=<xyz>
+L0000002C Dec 18 15:36:37 proxmox-new postfix/qmgr[6194]: 1C6B541C5D: from=<test at test.localdomain>, size=7298, nrcpt=4 (queue active)
+L00000034 Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test1 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
+L00000035 Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test2 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
+L00000036 Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test3 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
+L00000037 Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test4 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
+L00000038 Dec 18 15:36:37 proxmox-new postfix/qmgr[6194]: 1C6B541C5D: removed
 
diff --git a/tests/test_output_before_queue_qid b/tests/test_output_before_queue_qid
index 256287c..f57f98e 100644
--- a/tests/test_output_before_queue_qid
+++ b/tests/test_output_before_queue_qid
@@ -15,27 +15,27 @@ TO:5FDCCC85:1C6B541C5D:A: from <test at test.localdomain> to <test3 at localhost> (192
 TO:5FDCCC85:1C6B541C5D:A: from <test at test.localdomain> to <test2 at localhost> (192.168.22.40[192.168.22.40]:25)
 TO:5FDCCC85:1C6B541C5D:A: from <test at test.localdomain> to <test1 at localhost> (192.168.22.40[192.168.22.40]:25)
 SMTP:
-L0000001C Dec 18 15:36:32 proxmox-new postfix/smtpd[29902]: connect from test.localdomain[192.168.22.40]
-L0000001D Dec 18 15:36:33 proxmox-new postfix/smtpd[29902]: NOQUEUE: client=test.localdomain[192.168.22.40]
-L00000020 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: connect from localhost.localdomain[127.0.0.1]
-L00000021 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: 1C6B541C5D: client=localhost.localdomain[127.0.0.1], orig_client=test.localdomain[192.168.22.40]
-L00000028 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: disconnect from localhost.localdomain[127.0.0.1] ehlo=1 xforward=1 mail=1 rcpt=4 data=1 commands=8
-L0000002A Dec 18 15:36:37 proxmox-new postfix/smtpd[29902]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (436445DD3BD7D71595); from=<test at test.localdomain> to=<test2 at localhost> proto=ESMTP helo=<vger.kernel.org>
-L00000030 Dec 18 15:39:37 proxmox-new postfix/smtpd[29902]: disconnect from test.localdomain[192.168.22.40] ehlo=1 mail=1 rcpt=4 bdat=1 quit=1 commands=8
+L00000025 Dec 18 15:36:32 proxmox-new postfix/smtpd[29902]: connect from test.localdomain[192.168.22.40]
+L00000026 Dec 18 15:36:33 proxmox-new postfix/smtpd[29902]: NOQUEUE: client=test.localdomain[192.168.22.40]
+L00000029 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: connect from localhost.localdomain[127.0.0.1]
+L0000002A Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: 1C6B541C5D: client=localhost.localdomain[127.0.0.1], orig_client=test.localdomain[192.168.22.40]
+L00000031 Dec 18 15:36:37 proxmox-new postfix/smtpd[29713]: disconnect from localhost.localdomain[127.0.0.1] ehlo=1 xforward=1 mail=1 rcpt=4 data=1 commands=8
+L00000033 Dec 18 15:36:37 proxmox-new postfix/smtpd[29902]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (436445DD3BD7D71595); from=<test at test.localdomain> to=<test2 at localhost> proto=ESMTP helo=<vger.kernel.org>
+L00000039 Dec 18 15:39:37 proxmox-new postfix/smtpd[29902]: disconnect from test.localdomain[192.168.22.40] ehlo=1 mail=1 rcpt=4 bdat=1 quit=1 commands=8
 FILTER: 436445DD3BD7D71595
-L0000001E Dec 18 15:36:33 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: new mail message-id=<xyz>#012
-L0000001F Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: SA score=0/5 time=3.611 bayes=undefined autolearn=disabled hits=DKIMWL_WL_HIGH(-0.001),DKIM_SIGNED(0.1),DKIM_VALID(-0.1),DKIM_VALID_AU(-0.1),DKIM_VALID_EF(-0.1),MAILING_LIST_MULTI(-1),RCVD_IN_DNSWL_HI(-5),SPF_HELO_NONE(0.001),SPF_NONE(0.001)
-L00000024 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test2 at localhost> (1C6B541C5D) (rule: default-accept)
-L00000025 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test3 at localhost> (1C6B541C5D) (rule: default-accept)
-L00000026 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test4 at localhost> (1C6B541C5D) (rule: default-accept)
-L00000027 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test1 at localhost> (1C6B541C5D) (rule: default-accept)
-L00000029 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: processing time: 3.701 seconds (3.611, 0.021, 0)
+L00000027 Dec 18 15:36:33 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: new mail message-id=<xyz>#012
+L00000028 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: SA score=0/5 time=3.611 bayes=undefined autolearn=disabled hits=DKIMWL_WL_HIGH(-0.001),DKIM_SIGNED(0.1),DKIM_VALID(-0.1),DKIM_VALID_AU(-0.1),DKIM_VALID_EF(-0.1),MAILING_LIST_MULTI(-1),RCVD_IN_DNSWL_HI(-5),SPF_HELO_NONE(0.001),SPF_NONE(0.001)
+L0000002D Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test2 at localhost> (1C6B541C5D) (rule: default-accept)
+L0000002E Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test3 at localhost> (1C6B541C5D) (rule: default-accept)
+L0000002F Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test4 at localhost> (1C6B541C5D) (rule: default-accept)
+L00000030 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: accept mail to <test1 at localhost> (1C6B541C5D) (rule: default-accept)
+L00000032 Dec 18 15:36:37 proxmox-new pmg-smtp-filter[30046]: 436445DD3BD7D71595: processing time: 3.701 seconds (3.611, 0.021, 0)
 QMGR:
-L00000022 Dec 18 15:36:37 proxmox-new postfix/cleanup[29714]: 1C6B541C5D: message-id=<xyz>
-L00000023 Dec 18 15:36:37 proxmox-new postfix/qmgr[6194]: 1C6B541C5D: from=<test at test.localdomain>, size=7298, nrcpt=4 (queue active)
-L0000002B Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test1 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
-L0000002C Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test2 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
-L0000002D Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test3 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
-L0000002E Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test4 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
-L0000002F Dec 18 15:36:37 proxmox-new postfix/qmgr[6194]: 1C6B541C5D: removed
+L0000002B Dec 18 15:36:37 proxmox-new postfix/cleanup[29714]: 1C6B541C5D: message-id=<xyz>
+L0000002C Dec 18 15:36:37 proxmox-new postfix/qmgr[6194]: 1C6B541C5D: from=<test at test.localdomain>, size=7298, nrcpt=4 (queue active)
+L00000034 Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test1 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
+L00000035 Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test2 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
+L00000036 Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test3 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
+L00000037 Dec 18 15:36:37 proxmox-new postfix/smtp[29913]: 1C6B541C5D: to=<test4 at localhost>, relay=192.168.22.40[192.168.22.40]:25, delay=0.15, delays=0.05/0/0.05/0.05, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C19A3F62578)
+L00000038 Dec 18 15:36:37 proxmox-new postfix/qmgr[6194]: 1C6B541C5D: removed
 
diff --git a/tests/test_output_before_queue_search_string b/tests/test_output_before_queue_search_string
index 17d769f..da04042 100644
--- a/tests/test_output_before_queue_search_string
+++ b/tests/test_output_before_queue_search_string
@@ -23,5 +23,5 @@ CTIME: 5FDCCD46
 CLIENT: 10.0.0.1
 TO:5FDCCD46:T5FDCCD46L00000000:N: from <rbl_reject_test at localhost.localdomain> to <test at reject.localhost.localdomain>
 LOGS:
-L00000031 Dec 18 15:39:50 proxmox-new postfix/postscreen[32700]: NOQUEUE: reject: RCPT from [10.0.0.1]:34453: 550 5.7.1 Service unavailable; client [10.0.0.1] blocked using zen.spamhaus.org; from=<rbl_reject_test at localhost.localdomain>, to=<test at reject.localhost.localdomain>, proto=ESMTP, helo=<localhost.localdomain>
+L0000003A Dec 18 15:39:50 proxmox-new postfix/postscreen[32700]: NOQUEUE: reject: RCPT from [10.0.0.1]:34453: 550 5.7.1 Service unavailable; client [10.0.0.1] blocked using zen.spamhaus.org; from=<rbl_reject_test at localhost.localdomain>, to=<test at reject.localhost.localdomain>, proto=ESMTP, helo=<localhost.localdomain>
 
diff --git a/tests/tests_before_queue.rs b/tests/tests_before_queue.rs
index e6f42a7..4227de4 100644
--- a/tests/tests_before_queue.rs
+++ b/tests/tests_before_queue.rs
@@ -159,3 +159,28 @@ fn before_queue_to() {
     let output_reader = BufReader::new(&output.stdout[..]);
     utils::compare_output(output_reader, expected_output);
 }
+
+#[test]
+fn before_queue_from_to() {
+    let output = Command::new(utils::log_tracker_path())
+        .arg("-vv")
+        .arg("-s")
+        .arg("1608300000")
+        .arg("-e")
+        .arg("1608302400")
+        .arg("-i")
+        .arg("tests/test_input_mixed")
+        .arg("-f")
+        .arg("mailtestsender3")
+        .arg("-t")
+        .arg("pmgtest")
+        .output()
+        .expect("failed to execute pmg-log-tracker");
+
+    let expected_file =
+        File::open("tests/test_output_before_queue_from_to").expect("failed to open test_output");
+
+    let expected_output = BufReader::new(&expected_file);
+    let output_reader = BufReader::new(&output.stdout[..]);
+    utils::compare_output(output_reader, expected_output);
+}
-- 
2.20.1




More information about the pmg-devel mailing list