mirror of
https://git.proxmox.com/git/pmg-log-tracker
synced 2025-04-28 13:03:18 +00:00
![]() 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> |
||
---|---|---|
.cargo | ||
debian | ||
src | ||
tests | ||
.gitignore | ||
Cargo.toml | ||
Makefile | ||
README | ||
rustfmt.toml |
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.