Commit Graph

13 Commits

Author SHA1 Message Date
Mira Limbeck
ef4e4370a3 change tests to use faketime
We only have the month, day, hours, minutes and seconds available to us,
but not the year. Because of this we assume the logs are always relative
to the current year. This means when running the log tracker the CTIME
is calculated based on the current year and once a new year starts, all
old tests have to be updated to match the new year.

To work around this issue, use 'faketime' to set the time to 2020-12-31
23:59:59 as all tests assume 2020 as the year.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-03-22 16:20:32 +01:00
Fabian Grünbichler
77b430e04a debcargo: fix maintainer directive
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-02-01 11:29:02 +01:00
Mira Limbeck
c409629f80 change case sensitive string match to case insensitive
With the rewrite from C to Rust the search string match was changed to
be case sensitive by accident. Fix this by comparing the lowercase values
of both the input and the search string.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-11-17 08:18:21 +01:00
Mira Limbeck
dbab0bf5db add output for proxy-reject with 'Syntax:' message
Messages like the following
'proxy-reject: END-OF-MESSAGE: 501 5.5.2 Syntax: MAIL FROM: <address>;'
can happen if an EHLO keyword is announced which is not handled by
pmg-smtp-filter (see #2795). This patch adds output to the log tracker
so this mail shows up as 'rejected' in the GUI instead of silently
ignoring it.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-09-03 17:15:23 +02:00
Mira Limbeck
ff635f99db add testcase for mixed '-t' and '-x' options in before-queue filtering
Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2020-05-19 16:33:53 +02:00
Mira Limbeck
5cce7a774a add testcase for accepted/blocked/quarantined mail
The testcase contains a mail that is accepted for one address, blocked
for another and quarantined for a third address.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2020-05-18 14:24:54 +02:00
Mira Limbeck
54a122d957 add test case for 'from' and 'to' together
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@proxmox.com>
2020-05-06 13:20:58 +02:00
Stoiko Ivanov
d1dde9d3e1 add test for before queue dstatus
Reviewed-By: Mira Limbeck <m.limbeck@proxmox.com>
Tested-By: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-05-06 13:12:13 +02:00
Mira Limbeck
093033c8cd add a test case for recipient filtering
Add a before queue test case to test recipient filtering. Previously
all SEntry filter entries were printed because filtering failed. Now
test that it only prints the specified ones.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2020-04-06 11:57:25 +02:00
Mira Limbeck
20141d5863 fix wrong order of arguments
This fixes the output in the case of a failed assert. Exptected and
Command were swapped.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2020-04-06 11:57:22 +02:00
Mira Limbeck
85fdd484ed add test for the exclude_greylist fix
This tests the before queue case with both '-g' and 'n' options set.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2020-03-24 11:40:19 +01:00
Fabian Grünbichler
abd7fe2d82 packaging cleanup
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-02-28 11:58:09 +01:00
Mira Limbeck
aee1def7c3 add tests
Add tests for some command line options. Not all have a test yet, but at
least most of the ones used by the GUI (-s, -e, -q, -x). '-g' and '-n' are
currently still missing.

The tests will only be valid until end of January 31st 2021 because of
missing year info in the syslog.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-02-21 09:47:37 +01:00