Add logwatch maillog.conf file to support /var/log/mail/#2112
Add logwatch maillog.conf file to support /var/log/mail/#2112georglauterbach merged 3 commits intodocker-mailserver:masterfrom
Conversation
| *ExpandRepeats | ||
|
|
||
| # Keep only the lines in the proper date range... | ||
| *ApplyStdDate |
There was a problem hiding this comment.
These come directly from the /usr/share/logwatch/default.conf/logfiles/maillog.conf file
To create the maillog.conf file that is in my PR is a modified version of the original.
There was a problem hiding this comment.
I understand. I would remove the comments on the top, because THIS file isn't maintained Kenneth 😉
I guess /usr/share/logwatch/default.conf/logfiles/maillog.conf is read first and extended/overwritten by the local changes made in /etc/logwatch/conf/logfiles/maillog.conf. That said, are the four lines at the end necessary (Line 26-30)?
There was a problem hiding this comment.
Oops.. yeah - I should have removed the comment at the top.
I've now reviewed the doc on logwatch http://www.stellarcore.net/logwatch/tabs/docs/HOWTO-Customize-LogWatch.html - and better understand the way to customize it.
Very good review - thank you.
There was a problem hiding this comment.
I've tested it and it seems to work 👍 The daily logwatch mail went from ~60KB to 170KB.
There was a problem hiding this comment.
FWIW - I've been running with this change as well for days now.
It is also possible to test this by shelling into the container
docker exec -it mailserver bash
logwatch --range Yesterday
If you have an existing mail server container that has been running for more than 1 day (because until you have a logrotate happen, the problem doesn't manifest itself) - then you can test things being broken.
Then by adding the /etc/logwatch/conf/logfiles/maillog.conf file - testing again, will result in a complete logwatch showing email that is in the /var/log/mail/mail.log.1 file.
There was a problem hiding this comment.
If you have an existing mail server container that has been running for more than 1 day
fyi: The (rotated) logs are kept during container restarts (if you use the default docker-compose.yml)
There was a problem hiding this comment.
Agree - a new installation with no rotations (ever) would not have a /var/log/mail/mail.log.1 file.
I should have been more precise that you need to have data in a /var/log/mail/mail.log.1 file to test in a sane way.
|
Would just an additional symlink also work?
|
|
An additional symlink might work most of the time. Especially with the default 'Yesterday' logwatch parameter. There are additional archive files which the Adding |
|
If nobody complains, I'll merge this in 1-2 days. |
|
LGTM |
|
#2109 should be merged first though @casperklein :) |
|
Haha. JUST thought the same. You were some seconds faster. |
|
This should be merged tomorrow, 11th August, when the pipelines for the |
assuming the fact that the major outage is fixed soon 🚀 https://www.githubstatus.com/ |
All systems are operational again. I will merge this when all tests have passed. |
|
@all-contributors add @andrewlow for code |
|
I've put up a pull request to add @andrewlow! 🎉 |
|
Thanks for all the work on this project - it's been a pleasure to participate. |
Description
Create a new
target/logwatchfile tree.Add a
maillog.conffile that configures logwatch to look in the/var/log/mail/*pathModify Dockerfile to pull from this target and place in the appropriate
/etc/logwatchlocationFixes #2108
Type of change
Checklist:
docs/)