Skip to content
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

Delete duplicate logrotate config for mail.log #214

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions scripts/common-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ rsyslog_log_format() {
sed -i -E "s/<log-format>/${log_format}/" /etc/rsyslog.conf
}

logrotate_remove_duplicate_mail_log() {
if egrep -q '^/var/log/mail.log' /etc/logrotate.d/logrotate.conf; then
bokysan marked this conversation as resolved.
Show resolved Hide resolved
info "Removing /var/log/mail.log from /etc/logrotate.d/rsyslog"
sed -i -E '/^\/var\/log\/mail.log/d' /etc/logrotate.d/rsyslog
fi
}

anon_email_log() {
local anon_email="${ANONYMIZE_EMAILS}"
if [[ "${anon_email}" == "true" || "${anon_email}" == "1" || "${anon_email}" == "yes" || "${anon_email}" == "y" ]]; then
Expand Down
1 change: 1 addition & 0 deletions scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ announce_startup # Print startup banner
setup_timezone # Check if we need to configure the container timezone
check_environment_sane # Check if the the environment is sane
rsyslog_log_format # Setup rsyslog output format
logrotate_remove_duplicate_mail_log # Remove duplicate logrotate mail.log entry
anon_email_log # Setup email anonymizer
setup_conf # Copy over files from /etc/postfix.template to /etc/postfix, if the user mounted the folder manually
reown_folders # Make and reown /var/spool/postfix/ folders
Expand Down