Mainly it’s scripting based on usual linux programs. We collect (copy) every email with maillog - maybe someone could point me in a direction to extract all sender and receiver email-adresses. Or do I overlook something which is already there?
Basically the intention is to get a yearly report of all emails coming in (not the rejected ones) with the full email-adress i.e. john.doe@example.com. As well as all adresses the users sent to anyone. Also with the full email-adress.
I tried and struggled around with nethserver-awstats. It shows only one month (December, but no other). Even when I pick another let’s say November, nothing is dating up in the stats. In the default the config is pointing to /var/log/maillog. Of course there a a few older rotated other maillog files. It seems, they are not examined. Unfortunately googling around is not helping much - have you got any idea?
I believe, you should scroll down, compare the lists with different selection (esp. Dec vs. YEAR)
Only the second section constantly displays monthly statistics.
perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=awstats.maillog.conf -update
Create/Update database for config “/etc/awstats/awstats.maillog.conf” by AWStats version 7.8 (build 20200416)
From data in log file “perl /usr/share/awstats/tools/maillogconvert.pl standard < /var/log/test |”…
Phase 1 : First bypass old records, searching new record…
Searching new records from beginning of log file…
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)…
Jumped lines in file: 0
Parsed lines in file: 23668
Found 0 dropped records,
Found 0 comments,
Found 0 blank records,
Found 22537 corrupted records,
Found 0 old records,
Found 1131 new qualified records.
What does it mean, that there are the 22537 corrupted records? Now awstats is showing some statistc - I feel there’s missing a lot email.
created a bash-script i.e. mail_sort.sh to sort the old logs:
#!/bin/bash
for file in maillog-* ; do
sort -k1,1rn < “$file”
done > test
In the /etc/awstats config file for maillog I changed for the initial run to
LogFile=“perl /usr/share/awstats/tools/maillogconvert.pl standard < /var/log/test |”
Only a few errors ocurred, that’s o.k. for me.
I reverted the awstats.maillog.conf back to
LogFile=“perl /usr/share/awstats/tools/maillogconvert.pl standard < /var/log/maillog |”