]> git.proxmox.com Git - pmg-log-tracker.git/log
pmg-log-tracker.git
8 weeks agobump version to 2.5.0 master
Thomas Lamprecht [Mon, 26 Feb 2024 16:47:59 +0000 (17:47 +0100)]
bump version to 2.5.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 weeks agoupdate debian/control and check in debian/rules
Thomas Lamprecht [Mon, 26 Feb 2024 19:23:06 +0000 (20:23 +0100)]
update debian/control and check in debian/rules

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 weeks agobump version to 2.4.2
Stoiko Ivanov [Mon, 26 Feb 2024 14:18:30 +0000 (15:18 +0100)]
bump version to 2.4.2

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 months agocleanup: fix clippy warnings
Mira Limbeck [Tue, 20 Feb 2024 10:06:48 +0000 (11:06 +0100)]
cleanup: fix clippy warnings

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2 months agocleanup: remove unused strftime function
Mira Limbeck [Tue, 20 Feb 2024 10:06:47 +0000 (11:06 +0100)]
cleanup: remove unused strftime function

since we switched to proxmox_time::strftime_local for printing the start
and end times using local time, the strftime functions in src/time.rs is
unused and can be removed

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2 months agotests: update for log tracker time handling changes
Mira Limbeck [Tue, 20 Feb 2024 10:06:46 +0000 (11:06 +0100)]
tests: update for log tracker time handling changes

since we now calculate the time in UTC rather than local time, the time
values of each test had to be touched. those should differ by `E10`
(3600 seconds) in most cases since we set the TZ to Europe/Vienna for
the tests.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2 months agotests: improve test output consistency
Mira Limbeck [Tue, 20 Feb 2024 10:06:45 +0000 (11:06 +0100)]
tests: improve test output consistency

`expected` and `command` are more helpful than `new` and `old`.
the order of `expected` and `command` should now always be the same:
expected before command

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2 months agorfc3339: move timezone offset compatibility code to old time parser
Mira Limbeck [Tue, 20 Feb 2024 10:06:44 +0000 (11:06 +0100)]
rfc3339: move timezone offset compatibility code to old time parser

The compatibility code was added to the new rfc3339 code path temporarily so
that the old code path would not be changed before the PMG 8 release.

Now move it to the old time format code to make sure the rfc3339 code path
works as expected. Since we have all the information we need (year, month,
day, hours, minutes, seconds, timezone), there's no need for a workaround in
this code path.

As a side effect of parsing the time format `YYYY-MM-DD HH:MM:SS` in
localtime, it's now possible to parse an rfc3339 compliant format
(except for fractional seconds).

The change needs to be accompanied by one in pmg-api MailTracker.pmg to
keep the time displayed in the GUI the same for the old time format, and
correct for the new rfc3339 format.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2 months agouse pico-args instead of clap
Dominik Csapak [Wed, 25 Oct 2023 11:20:26 +0000 (13:20 +0200)]
use pico-args instead of clap

Instead of upgrading from clap3 to clap4 (which seems to change their
interface every year or so), switch to the much smaller pico-args. (Same
as we did for termproxy recently, see [0])

It has almost all features we need (except producing help output) and
supports OsString, but wihout any dependencies. This decreases compile
time and reduces the size of the resulting binary. It also reduces the
lines of code.

The only difference is now the different output for errors, e.g. for
missing values of options.

Help output is copied from the old clap output.

0: https://git.proxmox.com/?p=pve-xtermjs.git;a=commitdiff;h=24d707d0506b120a085b06b5f2b6000696879a1e

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Mira Limbeck <m.limbeck@proxmox.com>
Reviewed-by: Mira Limbeck <m.limbeck@proxmox.com>
9 months agobump version to 2.4.1
Thomas Lamprecht [Wed, 28 Jun 2023 10:33:15 +0000 (12:33 +0200)]
bump version to 2.4.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 months agotests: update to match the compatibility changes
Mira Limbeck [Wed, 28 Jun 2023 08:54:29 +0000 (10:54 +0200)]
tests: update to match the compatibility changes

Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
9 months agoadd compatibility with API/Tracking Center
Mira Limbeck [Wed, 28 Jun 2023 08:54:28 +0000 (10:54 +0200)]
add compatibility with API/Tracking Center

The API assumes the timestamps to be in the local timezone rather than
UTC. It then subtracts the timezone offset leading to wrong values when
timestamps are in UTC, but timezone is not.

For compatibility, add the local timezone to those timestamps.

Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
10 months agobuildsys: derive upload dist automatically
Thomas Lamprecht [Mon, 26 Jun 2023 16:14:27 +0000 (18:14 +0200)]
buildsys: derive upload dist automatically

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobump version to 2.4.0
Thomas Lamprecht [Mon, 26 Jun 2023 16:03:28 +0000 (18:03 +0200)]
bump version to 2.4.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agotests: add rfc3339 timestamp test
Mira Limbeck [Mon, 26 Jun 2023 10:41:42 +0000 (12:41 +0200)]
tests: add rfc3339 timestamp test

for this test `faketime` is not required since the year is part of the
timestamp

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agoadd support for bookworm syslog time format
Mira Limbeck [Mon, 26 Jun 2023 10:41:41 +0000 (12:41 +0200)]
add support for bookworm syslog time format

Adds `proxmox-time` as dependency to parse the timestamp

Since parse_rfc3339 can't handle microseconds, we try to remove the dot
followed by 6 digits of microseconds before passing it to parse_rfc3339.

A fallback to the previous format is used when when it fails to parse
the new format.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: expand clean target
Thomas Lamprecht [Mon, 26 Jun 2023 15:55:37 +0000 (17:55 +0200)]
buildsys: expand clean target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: avoid no-pre-clean flag
Thomas Lamprecht [Mon, 26 Jun 2023 15:55:34 +0000 (17:55 +0200)]
buildsys: avoid no-pre-clean flag

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: use dpkg default makefile fragements
Thomas Lamprecht [Mon, 26 Jun 2023 15:55:13 +0000 (17:55 +0200)]
buildsys: use dpkg default makefile fragements

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: only get git revision if actually used
Thomas Lamprecht [Mon, 26 Jun 2023 15:54:48 +0000 (17:54 +0200)]
buildsys: only get git revision if actually used

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agod/copyright: use machine readable format
Thomas Lamprecht [Mon, 26 Jun 2023 15:54:27 +0000 (17:54 +0200)]
d/copyright: use machine readable format

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: re-add reference to GITVERSION
Stoiko Ivanov [Mon, 26 Jun 2023 10:58:36 +0000 (12:58 +0200)]
buildsys: re-add reference to GITVERSION

this was dropped when changing to debcargo, but d/docs still
references it.

Without this patch building with sbuild does not work.

Fixes: e029c60dff35f9d4f15419e9c6e873bf837f1840
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 months agotests: explicitly set timezone for testcases with unix timestamps
Stoiko Ivanov [Mon, 19 Jun 2023 18:40:48 +0000 (20:40 +0200)]
tests: explicitly set timezone for testcases with unix timestamps

noticed when building with sbuild, which uses UTC as timezone:
Due to the parsing of traditional syslog time information (which does
not contain timezone information) the testcases passing
unix-timestamps as arguments failed.

Explicitly setting TZ to Europe/Vienna fixes the tests (and makes the
assumption visible)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 months agobuildsys: add sbuild convenience target
Stoiko Ivanov [Fri, 16 Jun 2023 15:50:19 +0000 (17:50 +0200)]
buildsys: add sbuild convenience target

and only call lintian on the source-package for the phony dsc target,
as sbuild calls it anyways

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 months agod/s/format: mark package as native
Stoiko Ivanov [Tue, 30 May 2023 16:06:33 +0000 (18:06 +0200)]
d/s/format: mark package as native

and adapt makefile variables

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
16 months agod/control: update generated meta data from newer debcargo
Thomas Lamprecht [Fri, 2 Dec 2022 10:26:53 +0000 (11:26 +0100)]
d/control: update generated meta data from newer debcargo

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agobump version to 2.3.2-1
Thomas Lamprecht [Fri, 25 Nov 2022 10:38:14 +0000 (11:38 +0100)]
bump version to 2.3.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agocli opts: use get_count for "verbose" flag
Thomas Lamprecht [Fri, 25 Nov 2022 10:36:30 +0000 (11:36 +0100)]
cli opts: use get_count for "verbose" flag

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agoupdate clap to 0.3.23
Thomas Lamprecht [Fri, 25 Nov 2022 10:35:21 +0000 (11:35 +0100)]
update clap to 0.3.23

to get some convenience things like the get_count helper

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agoupdate clap from 2 to 3
Thomas Lamprecht [Thu, 24 Nov 2022 17:47:03 +0000 (18:47 +0100)]
update clap from 2 to 3

only relevant change is the assertion that multiple(true) takes a
value, so we need to change to the new actions system.

Note that with 3.2.20+ we could switch to args.get_count("verbose")
saving us the unwrap/dereference dance.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agocargo fmt
Thomas Lamprecht [Thu, 24 Nov 2022 17:46:49 +0000 (18:46 +0100)]
cargo fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agocode cleanup: avoid some bload on match return
Thomas Lamprecht [Wed, 13 Jul 2022 09:46:19 +0000 (11:46 +0200)]
code cleanup: avoid some bload on match return

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agoclippy fixes
Thomas Lamprecht [Wed, 13 Jul 2022 09:42:00 +0000 (11:42 +0200)]
clippy fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agocargo: relaxe libc dependency to minor 0.2 version
Thomas Lamprecht [Wed, 13 Jul 2022 09:35:04 +0000 (11:35 +0200)]
cargo: relaxe libc dependency to minor 0.2 version

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agocargo: update clap to 2.33
Thomas Lamprecht [Wed, 13 Jul 2022 09:34:44 +0000 (11:34 +0200)]
cargo: update clap to 2.33

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 months agotree wide cargo fmt
Thomas Lamprecht [Wed, 13 Jul 2022 09:30:26 +0000 (11:30 +0200)]
tree wide cargo fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodrop 'time' dependency
Wolfgang Bumiller [Tue, 4 Jan 2022 13:57:23 +0000 (14:57 +0100)]
drop 'time' dependency

We're using a very old version of it and the functions we
actually use are available in glibc anyway.

The only difference I found was that the result of
glibc's `strptime()`'s `%s` does *not* want an additional
`.to_local()` call anymore...

... which was weird anyway.

As a minor optimization I pass the format string as `&CStr`
to avoid the memcpy.

(The CString::new() call in `strptime()` only happens during
parameter parsing)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
[dropped left-over and fixed FIXME]
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agoadd tests for DST change and year change
Stoiko Ivanov [Wed, 9 Feb 2022 11:31:58 +0000 (12:31 +0100)]
add tests for DST change and year change

based on our outbound production logs but anonymized

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agobuildsys: fix reference to DBG_DEB
Thomas Lamprecht [Tue, 1 Feb 2022 13:06:28 +0000 (14:06 +0100)]
buildsys: fix reference to DBG_DEB

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuildsys: use only one parenthesis style
Thomas Lamprecht [Tue, 1 Feb 2022 13:06:11 +0000 (14:06 +0100)]
buildsys: use only one parenthesis style

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.3.1-1
Thomas Lamprecht [Tue, 1 Feb 2022 12:32:06 +0000 (13:32 +0100)]
bump version to 2.3.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix logfile counting in months != january
Stoiko Ivanov [Tue, 1 Feb 2022 09:48:52 +0000 (10:48 +0100)]
fix logfile counting in months != january

the changes introduced in 1cdbebe57b2ddc255db240d7dbaf2165c482986d

changed the date handling to have current_month and current_year
represent the month and year at time of invocation.
This change was not carried over to the logfile collecting, which set
the current month to january.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Mira Limbeck <m.limbeck@proxmox.com>
2 years agobump d/control
Wolfgang Bumiller [Tue, 4 Jan 2022 15:02:18 +0000 (16:02 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 2.3.0-1
Wolfgang Bumiller [Tue, 4 Jan 2022 14:55:53 +0000 (15:55 +0100)]
bump version to 2.3.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agostick to time_t for time
Wolfgang Bumiller [Mon, 3 Jan 2022 14:02:14 +0000 (15:02 +0100)]
stick to time_t for time

especially those u32 conversions are simply completely wrong

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
[rebased]
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agodo not assume constant year based on file index
Stoiko Ivanov [Mon, 3 Jan 2022 16:09:54 +0000 (17:09 +0100)]
do not assume constant year based on file index

rather start with the current time at invocation and if the month in
the log is larger assume a year-wrap happened between logwriting and
invocation.

the old logic is flawed (but that can be said about parsing
traditional syslog timestamps (w/o year) in general) - it got worse
with the change in bullseye of rotating syslog weekly by default -
resulting in users losing one week of logs per day in the new year as
reported in https://forum.proxmox.com/threads/.102322/

Reviewed-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agoadd .gitignore file
Wolfgang Bumiller [Mon, 3 Jan 2022 13:56:08 +0000 (14:56 +0100)]
add .gitignore file

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump edition to 2021
Wolfgang Bumiller [Mon, 3 Jan 2022 12:22:12 +0000 (13:22 +0100)]
bump edition to 2021

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoswitch to anyhow, don't use old style imports
Wolfgang Bumiller [Mon, 3 Jan 2022 12:21:13 +0000 (13:21 +0100)]
switch to anyhow, don't use old style imports

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoclippy fixups
Wolfgang Bumiller [Mon, 3 Jan 2022 10:45:59 +0000 (11:45 +0100)]
clippy fixups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoadd test for empty to (dnsbl reject)
Stoiko Ivanov [Wed, 1 Dec 2021 18:02:30 +0000 (19:02 +0100)]
add test for empty to (dnsbl reject)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 years agofix #3758: fix `to` filter with empty NoqueueEntry `to` field
Mira Limbeck [Wed, 1 Dec 2021 15:41:57 +0000 (16:41 +0100)]
fix #3758: fix `to` filter with empty NoqueueEntry `to` field

We only compared the filter `to` with the Noqueue `to` when both were
not empty, and in turn set the nq.dstatus to DStatus::Invalid when they
didn't match.
But in the case of an empty Noqueue `to`, we have to skip it as well if
the filter `to` is not empty.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2 years agodebcargo: track updates
Thomas Lamprecht [Mon, 28 Jun 2021 15:04:06 +0000 (17:04 +0200)]
debcargo: track updates

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuildsys: upload to bullseye
Thomas Lamprecht [Mon, 28 Jun 2021 15:00:36 +0000 (17:00 +0200)]
buildsys: upload to bullseye

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 2.2.0-1
Thomas Lamprecht [Tue, 11 May 2021 14:01:43 +0000 (16:01 +0200)]
bump version to 2.2.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix mutable borrow panic on duplicate msgid
Mira Limbeck [Thu, 29 Apr 2021 13:25:08 +0000 (15:25 +0200)]
fix mutable borrow panic on duplicate msgid

Because of the relay before lmtp issue we now add and remove QEntrys
based on their message-id. But if the cleanup line containing the
message-id appears twice in the log for the same QEntry it keeps a weak
reference to itself which leads to a panic because of a mutable borrow
while it is already mutably borrowed in the 'finalize' function.

To circumvent this we check after the lookup if it is the same QEntry
and if so, insert it again with that message-id in the lookup table and
don't add the weak reference.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
3 years agocargo: more flexible versioned dependencies
Thomas Lamprecht [Wed, 24 Mar 2021 11:15:03 +0000 (12:15 +0100)]
cargo: more flexible versioned dependencies

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/cargo: use HTTPs for homepage
Thomas Lamprecht [Wed, 24 Mar 2021 11:10:26 +0000 (12:10 +0100)]
d/cargo: use HTTPs for homepage

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 2.1.9-1
Thomas Lamprecht [Wed, 24 Mar 2021 11:08:23 +0000 (12:08 +0100)]
bump version to 2.1.9-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 2.1.9-1
Stoiko Ivanov [Wed, 24 Mar 2021 10:49:58 +0000 (11:49 +0100)]
bump version to 2.1.9-1

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
3 years agoadd test case for relay removed before lmtp
Mira Limbeck [Tue, 23 Mar 2021 14:28:23 +0000 (15:28 +0100)]
add test case for relay removed before lmtp

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
3 years agoafter-queue: fix wrong DStatus if relay is 'removed' before 'lmtp' line
Mira Limbeck [Tue, 23 Mar 2021 14:28:22 +0000 (15:28 +0100)]
after-queue: fix wrong DStatus if relay is 'removed' before 'lmtp' line

We only match a QEntry with the relay Qentry in the after-queue case
when we get to the 'lmtp' line. This is because it contains a reference
from the first QEntry to the filter, and the filter contains a reference
to the relay QEntry.

If the relay log entries are finished before the 'lmtp' line, there's no
way to match the relay to the first QEntry and we still assume it is
before-queue filtered.

To fix this we try to match the QEntries via message-id and add weak
references to each other. Then we wait with finalizing either until the
other is also 'removed' (finished).

The message-id matching might break if the same message-id is used for
different entries, so this is rather a 'hack' than a nice solution, but
there's no other info in the logs we could use to match both QEntries.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
3 years agoclose #2106: show outgoing TLS connection in tracking center
Mira Limbeck [Tue, 23 Mar 2021 11:05:31 +0000 (12:05 +0100)]
close #2106: show outgoing TLS connection in tracking center

This is a best effort try to add the outgoing TLS connection information
to the output of pmg-log-tracker. The only thing we can match on is the
PID of the 'smtp' process. In the code we asumme that the TLS log entry
always happens before the actual smtp send entry that has a QID. This means
we save the TLS log entry in a map with the PID as key and then, once the
send entry happens, we look it up and add the log entry to the QEntry's
logs.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
3 years agochange tests to use faketime
Mira Limbeck [Mon, 22 Mar 2021 13:06:18 +0000 (14:06 +0100)]
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>
3 years agodebcargo: fix maintainer directive
Fabian Grünbichler [Mon, 1 Feb 2021 10:22:56 +0000 (11:22 +0100)]
debcargo: fix maintainer directive

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agobuild: track d/control
Fabian Grünbichler [Wed, 2 Dec 2020 12:18:52 +0000 (13:18 +0100)]
build: track d/control

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agobump version to 2.1.8-1
Thomas Lamprecht [Wed, 18 Nov 2020 18:29:27 +0000 (19:29 +0100)]
bump version to 2.1.8-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agochange case sensitive string match to case insensitive
Mira Limbeck [Mon, 9 Nov 2020 14:18:46 +0000 (15:18 +0100)]
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>
3 years agobump version to 2.1.7-1
Thomas Lamprecht [Thu, 3 Sep 2020 15:41:46 +0000 (17:41 +0200)]
bump version to 2.1.7-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoadd output for proxy-reject with 'Syntax:' message
Mira Limbeck [Fri, 28 Aug 2020 10:19:51 +0000 (12:19 +0200)]
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>
3 years agoparse_number: prevent panic on empty input
Fabian Grünbichler [Wed, 10 Jun 2020 13:22:53 +0000 (15:22 +0200)]
parse_number: prevent panic on empty input

if data is empty or the caller requested 0 digits, we can return early.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoparse_time: prevent panic on truncated input
Fabian Grünbichler [Wed, 10 Jun 2020 13:22:52 +0000 (15:22 +0200)]
parse_time: prevent panic on truncated input

'advancing' a slice by one is only a good idea if there is more data.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agobump version to 2.1.6-1
Thomas Lamprecht [Tue, 19 May 2020 16:05:02 +0000 (18:05 +0200)]
bump version to 2.1.6-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoadd testcase for mixed '-t' and '-x' options in before-queue filtering
Mira Limbeck [Tue, 19 May 2020 13:31:07 +0000 (15:31 +0200)]
add testcase for mixed '-t' and '-x' options in before-queue filtering

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
3 years agofix ToEntrys in FEntrys not being considered for 'to' filtering
Mira Limbeck [Tue, 19 May 2020 13:31:06 +0000 (15:31 +0200)]
fix ToEntrys in FEntrys not being considered for 'to' filtering

When a 'to' filter is specified and a mail has multiple 'to's with at
least one being accepted, the others blocked or quarantined and the
'to' for the accepted mail does not match, the entries in the filter
will be ignored even if one of them would match.
To fix it the filter ToEntrys are now considered in the 'to' check.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
3 years agofix before-queue filter string_match check
Mira Limbeck [Tue, 19 May 2020 13:31:05 +0000 (15:31 +0200)]
fix before-queue filter string_match check

In before-queue filtering a filter can be set on the SEntry. When a
search-string is set, we have to check both the SEntry and the attached
filter for a match, not just the SEntry. Otherwise some entries are not shown.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
3 years agoadd testcase for accepted/blocked/quarantined mail
Mira Limbeck [Fri, 15 May 2020 14:49:06 +0000 (16:49 +0200)]
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>
3 years agoprint blocked/quarantined entries if accepted mail exists
Mira Limbeck [Fri, 15 May 2020 14:49:05 +0000 (16:49 +0200)]
print blocked/quarantined entries if accepted mail exists

In the case of before-queue filtering we have the separation 'QEntry'
for accepted mails, as those are the only ones with a queue. And
'SEntry' for blocked and quarantined mails. But if a mail is accepted
for one address, but at the same time blocked or quarantined for another
address we previously discarded those entries. To fix it we now print it
in the 'QEntry' if the attached filter contains blocked and/or
quarantined mails.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
3 years agomake QID parsing more robust
Mira Limbeck [Fri, 15 May 2020 14:49:04 +0000 (16:49 +0200)]
make QID parsing more robust

As a user had the problem that 'fa' of 'fatal' matched for a QID,
increase the number of characters that have to match. The QID always has
at least 5 characters for the microseconds, so increase it to 5.

See http://www.postfix.org/postconf.5.html#enable_long_queue_ids

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
3 years agobump version to 2.1.5-1
Thomas Lamprecht [Thu, 14 May 2020 15:34:02 +0000 (17:34 +0200)]
bump version to 2.1.5-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodebcargo: add vcs links
Thomas Lamprecht [Wed, 6 May 2020 12:17:11 +0000 (14:17 +0200)]
debcargo: add vcs links

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoadd test case for 'from' and 'to' together
Mira Limbeck [Fri, 24 Apr 2020 15:21:50 +0000 (17:21 +0200)]
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>
3 years agoadd test for before queue dstatus
Stoiko Ivanov [Thu, 30 Apr 2020 15:01:50 +0000 (17:01 +0200)]
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>
3 years agoIntroduce before queue dstatus
Stoiko Ivanov [Thu, 30 Apr 2020 15:01:49 +0000 (17:01 +0200)]
Introduce before queue dstatus

Currently the status of a before queue filtered mail is the status of the
downstream delivery in case the downstream rejects or defers a mail.

This information is too little to distinguish between a mail which went
through the rule-system, and a locally generated one
(e.g. bounce or spamreport).

By introducing 3 new distinct dstatus values we can use the information to
correctly display the status of a mail in the GUI.

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>
4 years agobump version to 2.1.4-1
Thomas Lamprecht [Fri, 24 Apr 2020 17:29:11 +0000 (19:29 +0200)]
bump version to 2.1.4-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix from entries being shown even with a from filter
Mira Limbeck [Fri, 24 Apr 2020 15:21:49 +0000 (17:21 +0200)]
fix from entries being shown even with a from filter

When a 'from' and 'to' filter were set, we used a 'from || to' test to
see if we should print it or not. This patch changes this to a 'from &&
to' test. This gets rid of entries from unrelated senders ('from') when
a 'from filter did not match but the 'to' filter matched.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
4 years agobump version to 2.1.3-1
Thomas Lamprecht [Fri, 24 Apr 2020 10:17:21 +0000 (12:17 +0200)]
bump version to 2.1.3-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobefore-queue: set 'B' status for rule-system blocked mails
Dominik Csapak [Fri, 24 Apr 2020 09:26:50 +0000 (11:26 +0200)]
before-queue: set 'B' status for rule-system blocked mails

we want to show mails that were blocked by the rule-system as 'Blocked'
in the ui, so we have to use the dstatus of the to entry, and not
'NOQUEUE'

mails rejected by postscreen, etc. still show 'rejected'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoset dist to buster in upload target
Wolfgang Bumiller [Mon, 6 Apr 2020 10:23:15 +0000 (12:23 +0200)]
set dist to buster in upload target

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agouse -X in upload
Wolfgang Bumiller [Mon, 6 Apr 2020 10:16:46 +0000 (12:16 +0200)]
use -X in upload

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agobump version to 2.1.2-1
Wolfgang Bumiller [Mon, 6 Apr 2020 10:08:10 +0000 (12:08 +0200)]
bump version to 2.1.2-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoadd a test case for recipient filtering
Mira Limbeck [Thu, 2 Apr 2020 14:57:14 +0000 (16:57 +0200)]
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>
4 years agofix wrong order of arguments
Mira Limbeck [Thu, 2 Apr 2020 14:57:13 +0000 (16:57 +0200)]
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>
4 years agofix filter_matches() if condition
Mira Limbeck [Thu, 2 Apr 2020 14:57:12 +0000 (16:57 +0200)]
fix filter_matches() if condition

We need to check the filter entries when either the 'from' or 'to'
options are set. Also remove the && is_filtered as it is superfluous.

The !is_filtered check lead to all filter entries being printed all the
time.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
4 years agobump version to 2.1.1-1
Thomas Lamprecht [Tue, 24 Mar 2020 11:34:46 +0000 (12:34 +0100)]
bump version to 2.1.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd test for the exclude_greylist fix
Mira Limbeck [Fri, 20 Mar 2020 12:08:29 +0000 (13:08 +0100)]
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>
4 years agofix SEntry filter in before-queue case
Mira Limbeck [Fri, 20 Mar 2020 12:08:28 +0000 (13:08 +0100)]
fix SEntry filter in before-queue case

With before-queue filtering if we don't accept the mail (e.g.
quarantine), we don't have a queue which means we don't have a QEntry,
so the SEntry has to handle the filter entries (ToEntrys).

This means we can't just return from print() when either a 'from' or 'to'
filter is set or we exclude greylist entries or NDRs and no Noqueue entries
exist or no entry matches any of the filters.

So continue printing if there is no filter parameter set, but an FEntry
reference in the SEntry. If there's an FEntry reference, compare all ToEntrys
to the filter parameter and return if there is no match at all.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
4 years agoadd filter() and qentry() helper methods
Mira Limbeck [Fri, 20 Mar 2020 12:08:27 +0000 (13:08 +0100)]
add filter() and qentry() helper methods

This simplifies access to the structs by cloning and then upgrading them
if possible and returning an Option<Rc<>> instead of an Option<Weak<>>.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
4 years agobuildsys: clean more
Thomas Lamprecht [Mon, 9 Mar 2020 13:20:21 +0000 (14:20 +0100)]
buildsys: clean more

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobuildsys: drop writing rust-toolchain into build dir
Thomas Lamprecht [Mon, 9 Mar 2020 13:14:12 +0000 (14:14 +0100)]
buildsys: drop writing rust-toolchain into build dir

breaks source package generation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>