]> git.proxmox.com Git - pmg-log-tracker.git/log
pmg-log-tracker.git
4 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>
4 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>
4 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>
4 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>
4 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>
4 years agobuildsys: add rust- prefix to dsc name
Thomas Lamprecht [Mon, 9 Mar 2020 13:13:24 +0000 (14:13 +0100)]
buildsys: add rust- prefix to dsc name

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years ago2.1.0-1 build commit
Wolfgang Bumiller [Fri, 28 Feb 2020 11:50:50 +0000 (12:50 +0100)]
2.1.0-1 build commit

The actual package was built after the packaging cleanup.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopackaging cleanup
Fabian Grünbichler [Fri, 28 Feb 2020 10:58:09 +0000 (11:58 +0100)]
packaging cleanup

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agobump version to 2.1.0-1
Wolfgang Bumiller [Fri, 28 Feb 2020 08:34:09 +0000 (09:34 +0100)]
bump version to 2.1.0-1

note that the source package now has a rust- prefix

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoswitch to using debcargo
Wolfgang Bumiller [Fri, 28 Feb 2020 08:30:47 +0000 (09:30 +0100)]
switch to using debcargo

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoCargo.toml: add license, description, homepage and excludes
Wolfgang Bumiller [Fri, 28 Feb 2020 08:34:03 +0000 (09:34 +0100)]
Cargo.toml: add license, description, homepage and excludes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoadd .cargo/config and rustfmt.toml
Wolfgang Bumiller [Fri, 28 Feb 2020 08:22:15 +0000 (09:22 +0100)]
add .cargo/config and rustfmt.toml

.cargo/config since we build with debian packages as
dependencies by default

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoadd tests
Mira Limbeck [Tue, 18 Feb 2020 15:36:39 +0000 (16:36 +0100)]
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>
4 years agoadd before queue filter support
Mira Limbeck [Tue, 18 Feb 2020 15:36:38 +0000 (16:36 +0100)]
add before queue filter support

Initial before queue filter support. Requires a patch to pmg-api to add
the pmg-smtp-filter ID to the replies on a reject to correctly match the
pmg-smtp-filter to the smtpd.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoremove C source code
Mira Limbeck [Tue, 18 Feb 2020 15:36:37 +0000 (16:36 +0100)]
remove C source code

Remove src/pmg-log-tracker.c and src/Makefile as they are no longer
required.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agorewrite in rust
Mira Limbeck [Tue, 18 Feb 2020 15:36:36 +0000 (16:36 +0100)]
rewrite in rust

pmg-log-tracker has been rewritten in Rust. Functionality is the same.
Output sometimes has a different order than the pmg-log-tracker in C.
This only happens when the time of the entries match.

There's one change regarding the interface. In addition to the short
versions of arguments also long versions exist.

The implementation uses Rc<>, Weak<> and RefCell<> to make holding mutable
cross-references possible, without having to change the original logic
completely. This allowed for easier translation from C to Rust.

The file debian/cargo-checksum.json is required by dh-cargo, otherwise
it won't compile. The cargo-checksum.json should contain the upstream
.crate file which does not exist in this case, so we just create an
empty one with the required keys. (see 'Library package structure' in
https://wiki.debian.org/Teams/RustPackaging/Policy)

The change to the minimum version of debhelper required was done
according to other rust packages (rust-clap, rust-bindgen, rust-ripgrep).

Adds a README that provides an overview of the stages a mail passes
through and what we can use to match those together for a single mail.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agobump version to 2.0-1
Thomas Lamprecht [Mon, 22 Jul 2019 13:30:48 +0000 (15:30 +0200)]
bump version to 2.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 1.0-2
Thomas Lamprecht [Mon, 22 Jul 2019 06:34:32 +0000 (08:34 +0200)]
bump version to 1.0-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agorework build and packaging, add debian source package
Thomas Lamprecht [Mon, 22 Jul 2019 06:28:27 +0000 (08:28 +0200)]
rework build and packaging, add debian source package

diffoscope shows that the only real changes is the new SOURCE file we
ship in docs, like other packages.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix trailing whitespace
Dominik Csapak [Thu, 21 Feb 2019 08:42:07 +0000 (09:42 +0100)]
fix trailing whitespace

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoreplace static const int with #define
Dominik Csapak [Thu, 21 Feb 2019 08:42:06 +0000 (09:42 +0100)]
replace static const int with #define

using a static const int as array size is technically a
variable length array, so we should not use it that way

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoremove unused parameters
Dominik Csapak [Thu, 21 Feb 2019 08:42:05 +0000 (09:42 +0100)]
remove unused parameters

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agominor type fixes
Dominik Csapak [Thu, 21 Feb 2019 08:42:04 +0000 (09:42 +0100)]
minor type fixes

log->linenr is an unsigned long, we want to log it as a whole
mygzgetc returns a char anyway so change it to reflect that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agouse less magic numbers
Dominik Csapak [Thu, 21 Feb 2019 08:42:03 +0000 (09:42 +0100)]
use less magic numbers

use #defines or characters instead

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofix csum calculation and update checksums
Dominik Csapak [Thu, 21 Feb 2019 08:42:02 +0000 (09:42 +0100)]
fix csum calculation and update checksums

it was intended to be a rol instead of a simple left shift which changes the
checksums for the various programs (like 'proxprox', 'postfix/postscreen',
etc.) so we update those and use defines instead of the hardcoded hex values.
this makes it much more readable and less error prone

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoadd -i option for specifying an external file
Dominik Csapak [Thu, 21 Feb 2019 08:42:01 +0000 (09:42 +0100)]
add -i option for specifying an external file

where '-' is stdin

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoremove unused -I parameter
Dominik Csapak [Thu, 21 Feb 2019 08:42:00 +0000 (09:42 +0100)]
remove unused -I parameter

it was neither documented nor in use

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 years agofix upload target (--product pmg)
Dietmar Maurer [Thu, 21 Sep 2017 09:58:03 +0000 (11:58 +0200)]
fix upload target (--product pmg)

6 years agoavoid compiler warnings
Dietmar Maurer [Thu, 21 Sep 2017 09:53:42 +0000 (11:53 +0200)]
avoid compiler warnings

6 years agouse CLIENT instead of CONNECT
Dietmar Maurer [Wed, 20 Sep 2017 07:54:45 +0000 (09:54 +0200)]
use CLIENT instead of CONNECT

6 years agoonly print CONNECT if we do not have a CLIENT
Dietmar Maurer [Wed, 20 Sep 2017 07:51:04 +0000 (09:51 +0200)]
only print CONNECT if we do not have a CLIENT

6 years agoprint smtp connect for qentry
Dietmar Maurer [Wed, 20 Sep 2017 06:14:53 +0000 (08:14 +0200)]
print smtp connect for qentry

6 years agolog smtp entries with ID - "SMTP: <ID>"
Dietmar Maurer [Wed, 20 Sep 2017 06:07:15 +0000 (08:07 +0200)]
log smtp entries with ID -  "SMTP: <ID>"

6 years agoimprove usage info
Dietmar Maurer [Wed, 20 Sep 2017 06:05:10 +0000 (08:05 +0200)]
improve usage info

6 years agocorrectly print newlines to separate entries
Dietmar Maurer [Mon, 18 Sep 2017 09:50:52 +0000 (11:50 +0200)]
correctly print newlines to separate entries

6 years agoallow to match smtp entries by time and rel_line_nr, allow multiple '-q' options
Dietmar Maurer [Mon, 18 Sep 2017 06:55:32 +0000 (08:55 +0200)]
allow to match smtp entries by time and rel_line_nr, allow multiple '-q' options

Note: SMTP only entries do not have a valid qmgr ID

6 years agofix MAX_LOGFILES
Dietmar Maurer [Mon, 18 Sep 2017 05:07:48 +0000 (07:07 +0200)]
fix MAX_LOGFILES

6 years agoimplement verbose mode with/without logs
Dietmar Maurer [Fri, 15 Sep 2017 14:17:08 +0000 (16:17 +0200)]
implement verbose mode with/without logs

6 years agoadd line number to logs - so that we can order them correctly
Dietmar Maurer [Fri, 15 Sep 2017 08:46:37 +0000 (10:46 +0200)]
add line number to logs - so that we can order them correctly

6 years agore-add support for old log (for testing)
Dietmar Maurer [Fri, 15 Sep 2017 07:28:01 +0000 (09:28 +0200)]
re-add support for old log (for testing)

6 years agoinclude local relayed mails (mail to root)
Dietmar Maurer [Thu, 14 Sep 2017 10:22:55 +0000 (12:22 +0200)]
include local relayed mails (mail to root)

6 years agoremove unused code
Dietmar Maurer [Thu, 14 Sep 2017 06:13:19 +0000 (08:13 +0200)]
remove unused code

6 years agoinclude pmg-smtp-filter logs
Dietmar Maurer [Wed, 13 Sep 2017 09:52:58 +0000 (11:52 +0200)]
include pmg-smtp-filter logs

6 years agoadd correct AGPL3 header
Dietmar Maurer [Wed, 13 Sep 2017 08:55:20 +0000 (10:55 +0200)]
add correct AGPL3 header

6 years agoparse output from postfix/error
Dietmar Maurer [Wed, 13 Sep 2017 07:35:56 +0000 (09:35 +0200)]
parse output from postfix/error

6 years agocreate debian package
Dietmar Maurer [Wed, 13 Sep 2017 06:37:37 +0000 (08:37 +0200)]
create debian package

6 years agouse -Wpedantic
Dietmar Maurer [Tue, 12 Sep 2017 11:22:43 +0000 (13:22 +0200)]
use -Wpedantic

6 years agouse gzFile instead of gzFile*
Dietmar Maurer [Tue, 12 Sep 2017 10:23:04 +0000 (12:23 +0200)]
use gzFile instead of gzFile*

6 years agodo not access element outside array bounds
Dietmar Maurer [Tue, 12 Sep 2017 10:16:34 +0000 (12:16 +0200)]
do not access element outside array bounds

6 years agoavoid compiler warning about unused var
Dietmar Maurer [Tue, 12 Sep 2017 10:12:11 +0000 (12:12 +0200)]
avoid compiler warning about unused var

6 years agoavoid use of depreciated GMemChunk
Dietmar Maurer [Tue, 12 Sep 2017 10:06:12 +0000 (12:06 +0200)]
avoid use of depreciated GMemChunk

use newer g_slice allocator instead.

6 years agoadd cleanup targets
Dietmar Maurer [Tue, 12 Sep 2017 09:42:30 +0000 (11:42 +0200)]
add cleanup targets

6 years agoadd Makefile
Dietmar Maurer [Tue, 12 Sep 2017 08:31:23 +0000 (10:31 +0200)]
add Makefile

6 years agorename proxtrack.c to pmg-log-tracker.c
Dietmar Maurer [Tue, 12 Sep 2017 08:18:59 +0000 (10:18 +0200)]
rename proxtrack.c to pmg-log-tracker.c

6 years agofix copyright year
Dietmar Maurer [Tue, 12 Sep 2017 08:17:10 +0000 (10:17 +0200)]
fix copyright year

6 years agoproxtrack.c: copied from internal repository
Dietmar Maurer [Tue, 12 Sep 2017 08:16:21 +0000 (10:16 +0200)]
proxtrack.c: copied from internal repository