Commit Graph
11 Commits
Author SHA1 Message Date
robott 8a301ebf75 update mail-status
Dependency Check: In section # 2, the script now immediately checks for the existence of commands like awk, grep, tail, flock, etc., upon execution. If any are missing, the script exits safely with a clear error message instead of collapsing mid-run.

Systemd (Journalctl) Support: The get_log_stream function was overhauled. If it finds no text logs in /var/log (which is standard on new systems without rsyslog), the script automatically calls journalctl SYSLOG_FACILITY=2. This works seamlessly in both standard mode and Live Watch (-w) mode.

Automatic Pagination: The use_pager function was added at the end of the script. If the script detects it is running in a terminal, it pipes the entire output into less -R -F -X. This means if you output 1000 records, the text won't scroll off the screen; you can navigate with arrow keys. If there are few records (fitting on one screen), less automatically quits (-F).

New Year's Eve Bug Fix: A CURRENT_MONTH variable was added to bash and passed into the AWK script (as cur_m). AWK then compares whether the month in the log is greater than the current month. If it is, the log is from the previous year, and for sorting purposes, it prefixes the sorting key with a 0, otherwise 1. This ensures December records appear before January records in the final sorted list.
2026-09-07 18:23:47 +02:00
robott fdacdf8dae update mail-status
Path Validation (Directory Traversal): Added a strict check for the --log-dir argument. The script now only accepts /var/log or /var/log/mail to prevent it from processing malicious files if a user tries to pass an arbitrary path.

Secure Temp Files: Replaced the hardcoded /tmp/ directory with the environment-aware ${TMPDIR:-/tmp}/ everywhere mktemp is used, so the script respects the host operating system's settings.

LOCK File Security: Appended the user identifier (${UID}) to the LOCK file name (e.g., postfix_summary_${UID}.lock). This prevents a scenario where one user locks out execution for all other users on the system.
2026-09-07 17:15:16 +02:00
robott cb3678ed5e update mail-status rework
rework script
2026-09-07 09:26:11 +02:00
robott c5e42d3a3f update mail-status
rework script 
add better help
add -S 
and more QQ
2026-09-07 08:53:26 +02:00
robott 1cafd05a66 update mail-status
add -a IP
add -c export csv
fix logs redhat/debian
2026-09-07 08:41:49 +02:00
robott 61245fc8ad update mail-status
fix problem "Sep  6" "Sep 6" problem if sinngle date need 2x space
2026-09-06 11:38:36 +02:00
robott ebf6e16cfd new top 2026-03-27 22:11:45 +01:00
robott 209af5f0e0 add graylisting 2026-03-27 19:27:10 +01:00
robott b2fec3f7e8 Update mail-status.sh 2026-03-27 19:19:00 +01:00
robott 04fff874e3 Update mail-status.sh 2026-03-27 18:54:49 +01:00
robott 2c4ac98ff8 add mail-status file 2026-03-27 16:55:12 +01:00