No description
Find a file
Thomas Lamprecht 6df285f04c fix compile warning to avoid referring to the same lifetimes in inconsistent ways
Avoid mixing elided and hidden lifetime, not so big of an issue but
it's now a warning on (normal) compilation, so lets fix this to avoid
that more important warnings get missed in the future.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-10-31 11:59:33 +01:00
.cargo move .cargo/config to .cargo/config.toml 2024-06-20 12:27:00 +02:00
debian bump version to 3.0.1 2025-09-24 16:56:38 +02:00
src fix compile warning to avoid referring to the same lifetimes in inconsistent ways 2025-10-31 11:59:33 +01:00
tests tests: update for log tracker time handling changes 2024-02-23 18:29:17 +01:00
.gitignore gitignore: add rules for dpkg build artifacts 2024-10-03 16:06:14 +02:00
Cargo.toml bump version to 3.0.1 2025-09-24 16:56:38 +02:00
Makefile buildsys: derive upload dist automatically 2023-06-26 18:14:27 +02:00
README add before queue filter support 2020-02-21 09:47:35 +01:00
rustfmt.toml add .cargo/config and rustfmt.toml 2020-02-28 09:22:16 +01:00

The pmg-log-tracker extracts information out of the syslog to match all entries
related to a single mail. It does so by using the PID of 'smtpd' entries in the
log as key for the SEntry structs. The QID, an ID consisting of at least 2 all
upper case hex digits, is used for both QEntry structs and FEntry structs.

As a rule of thumb, SEntrys are used wherever the services 'postscreen' and
'smtpd' are involved. QEntrys on the other hand are only used when a queue is
involved (e.g. after-queue filtering passing the postscreen checks,
before-queue filtering when the mail is 'accepted'). FEntrys are used whenever
the filter (pmg-smtp-filter) is involved.

The typical flow of a mail (after-queue):

1. postscreen (NOQUEUE -> mail finished)
2. smtpd (pid matching)
3. cleanup -> qmgr (mail in queue, QID matching)
4. pmg-smtp-filter (rule system, accept/block, long (Q)ID matching)
5. lmtp/smtp/local/error (QID matching, filter ID matching in lmtp)
6. qmgr ('removed')
7. smtpd ('disconnected from')

Both 6 and 7 are required before the mail can be printed completely.
6 and 7 can be logged in arbitrary order.

The typical flow of a mail (before-queue):

1. postscreen (NOQUEUE -> mail finished)
2. smtpd 1 (pid matching)
3. pmg-smtp-filter (rule system, accept/block, long (Q)ID matching)
  - on accept match the QID
4. smtpd 2 (pid matching)
5. (optional, only on 'accept') cleanup -> qmgr (mail in queue, QID matching)
6. (optional, only on 'accept') smtp (QID matching)
7. (optional, only on 'accept') qmgr ('removed')
8. smtpd 2 ('disconnect from')
9. smtpd 1 (proxy-accept/proxy-reject, filter (Q)ID matching)
10. smtpd 1 ('disconnect from')

7, 8 and 10 are required before the mail can be printed completely.
7, 8 and 10 can be logged in arbitrary order.