add env var LOGWATCH_SENDER (#2362)

Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
Christian Raue 2022-01-10 12:29:11 +01:00 committed by GitHub
parent 4ae04f0d06
commit da17e8bf0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 4 deletions

View file

@ -266,9 +266,9 @@ Recipient address for pflogsumm reports.
##### PFLOGSUMM_SENDER ##### PFLOGSUMM_SENDER
From address for pflogsumm reports. Sender address (`FROM`) for pflogsumm reports if pflogsumm reports are enabled.
- **not set** => Use REPORT_SENDER or POSTMASTER_ADDRESS - **not set** => Use REPORT_SENDER
- => Specify the sender address - => Specify the sender address
##### LOGWATCH_INTERVAL ##### LOGWATCH_INTERVAL
@ -286,6 +286,13 @@ Recipient address for logwatch reports if they are enabled.
- **not set** => Use REPORT_RECIPIENT or POSTMASTER_ADDRESS - **not set** => Use REPORT_RECIPIENT or POSTMASTER_ADDRESS
- => Specify the recipient address(es) - => Specify the recipient address(es)
##### LOGWATCH_SENDER
Sender address (`FROM`) for logwatch reports if logwatch reports are enabled.
- **not set** => Use REPORT_SENDER
- => Specify the sender address
##### REPORT_RECIPIENT (deprecated) ##### REPORT_RECIPIENT (deprecated)
Enables a report being sent (created by pflogsumm) on a regular basis. Enables a report being sent (created by pflogsumm) on a regular basis.

View file

@ -188,9 +188,9 @@ PFLOGSUMM_TRIGGER=
# => Specify the recipient address(es) # => Specify the recipient address(es)
PFLOGSUMM_RECIPIENT= PFLOGSUMM_RECIPIENT=
# From address for pflogsumm reports. # Sender address (`FROM`) for pflogsumm reports if pflogsumm reports are enabled.
# #
# not set => Use REPORT_SENDER or POSTMASTER_ADDRESS # not set => Use REPORT_SENDER
# => Specify the sender address # => Specify the sender address
PFLOGSUMM_SENDER= PFLOGSUMM_SENDER=
@ -207,6 +207,12 @@ LOGWATCH_INTERVAL=
# => Specify the recipient address(es) # => Specify the recipient address(es)
LOGWATCH_RECIPIENT= LOGWATCH_RECIPIENT=
# Sender address (`FROM`) for logwatch reports if logwatch reports are enabled.
#
# not set => Use REPORT_SENDER
# => Specify the sender address
LOGWATCH_SENDER=
# Enables a report being sent (created by pflogsumm) on a regular basis. (deprecated) # Enables a report being sent (created by pflogsumm) on a regular basis. (deprecated)
# **0** => Report emails are disabled # **0** => Report emails are disabled
# 1 => Using POSTMASTER_ADDRESS as the recipient # 1 => Using POSTMASTER_ADDRESS as the recipient

View file

@ -47,6 +47,7 @@ function _setup_default_vars
# update REPORT_SENDER - must be done done after _check_hostname # update REPORT_SENDER - must be done done after _check_hostname
REPORT_SENDER="${REPORT_SENDER:=mailserver-report@${HOSTNAME}}" REPORT_SENDER="${REPORT_SENDER:=mailserver-report@${HOSTNAME}}"
LOGWATCH_SENDER="${LOGWATCH_SENDER:=${REPORT_SENDER}}"
PFLOGSUMM_SENDER="${PFLOGSUMM_SENDER:=${REPORT_SENDER}}" PFLOGSUMM_SENDER="${PFLOGSUMM_SENDER:=${REPORT_SENDER}}"
# set PFLOGSUMM_TRIGGER here for backwards compatibility # set PFLOGSUMM_TRIGGER here for backwards compatibility
@ -69,6 +70,7 @@ function _setup_default_vars
LOGWATCH_RECIPIENT="${LOGWATCH_RECIPIENT:=${REPORT_RECIPIENT}}" LOGWATCH_RECIPIENT="${LOGWATCH_RECIPIENT:=${REPORT_RECIPIENT}}"
VARS[LOGWATCH_RECIPIENT]="${LOGWATCH_RECIPIENT}" VARS[LOGWATCH_RECIPIENT]="${LOGWATCH_RECIPIENT}"
VARS[LOGWATCH_SENDER]="${LOGWATCH_SENDER}"
VARS[PFLOGSUMM_RECIPIENT]="${PFLOGSUMM_RECIPIENT}" VARS[PFLOGSUMM_RECIPIENT]="${PFLOGSUMM_RECIPIENT}"
VARS[PFLOGSUMM_SENDER]="${PFLOGSUMM_SENDER}" VARS[PFLOGSUMM_SENDER]="${PFLOGSUMM_SENDER}"
VARS[PFLOGSUMM_TRIGGER]="${PFLOGSUMM_TRIGGER}" VARS[PFLOGSUMM_TRIGGER]="${PFLOGSUMM_TRIGGER}"
@ -1484,6 +1486,8 @@ function _setup_logwatch
echo 'LogFile = /var/log/mail/freshclam.log' >>/etc/logwatch/conf/logfiles/clam-update.conf echo 'LogFile = /var/log/mail/freshclam.log' >>/etc/logwatch/conf/logfiles/clam-update.conf
echo "MailFrom = ${LOGWATCH_SENDER}" >> /etc/logwatch/conf/logwatch.conf
case "${LOGWATCH_INTERVAL}" in case "${LOGWATCH_INTERVAL}" in
'daily' ) 'daily' )
_notify 'inf' "Creating daily cron job for logwatch reports" _notify 'inf' "Creating daily cron job for logwatch reports"