SHA256
1
0
forked from pool/exim
exim/eximstats-html-update.py
Dirk Mueller 18cf88956e - update to 4.98 (bsc#1227423, CVE-2024-39929):
* The dkim_status ACL condition may now be used in data ACLs
  * The dkim_verbose logging control also enables logging of signing
  * The dkim_timestamps signing option now accepts zero to include
    a current timestamp but no expiry timestamp.
  * The recipients_max main option is now expanded.
  * Setting variables for "exim -be" can set a tainted value.
  * A dns:fail event.
  * The dsearch lookup supports search for a sub-path.
  * Include mailtest utility for simple connection checking.
  * Add SMTP WELLKNOWN extension.

OBS-URL: https://build.opensuse.org/package/show/server:mail/exim?expand=0&rev=290
2024-07-15 16:28:08 +00:00

40 lines
761 B
Python

#!/usr/bin/python3
import os, os.path, glob
outdir_base = '/srv/www/eximstats'
def main():
os.chdir('/var/log/exim')
reports = glob.glob('main.log-*.gz') + glob.glob('main.log-*.bz2')
for report in reports:
(base, ext) = os.path.splitext(report)
daystr = base[-8:]
outdir = os.path.join(outdir_base, daystr)
if os.path.exists(outdir):
continue
print('processing', daystr)
os.mkdir(outdir)
if ext == '.gz':
catprg = 'zcat'
elif ext == '.bz2':
catprg = 'bzcat'
os.system('%s %s | eximstats -html -charts -chartdir %s > %s/index.html' \
% (catprg, report, outdir, outdir))
if __name__ == '__main__':
main()