-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logwatch maillog.conf file to support /var/log/mail/ #2112
Add logwatch maillog.conf file to support /var/log/mail/ #2112
Conversation
target/logwatch/maillog.conf
Outdated
*ExpandRepeats | ||
|
||
# Keep only the lines in the proper date range... | ||
*ApplyStdDate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the '*' a typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/logwatch
file tree.Add a
maillog.conf
file that configures logwatch to look in the/var/log/mail/*
pathModify Dockerfile to pull from this target and place in the appropriate
/etc/logwatch
locationFixes #2108
Type of change
Checklist:
docs/
)