Delete duplicate logrotate config for mail.log (#214)

This commit is contained in:
Sushain Cherivirala 2024-10-17 05:33:02 -05:00 committed by GitHub
parent 9d3643a805
commit 994d4ae646
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -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
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

View file

@ -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