Handle Bcc being a fully qualified address in rotate script

GLPI #30996
tags/ipasserelle-base-0.2.68-1
Daniel Berteaud 7 years ago
parent 19722f2507
commit 4d00447448
  1. 8
      root/etc/cron.monthly/maillog-rotate

@ -11,8 +11,16 @@ if [ "$BCC" != "enabled" -o "$ARCHIVE" != "enabled" ]; then
fi fi
USER=$(db configuration getprop qpsmtpd BccUser || echo 'maillog') USER=$(db configuration getprop qpsmtpd BccUser || echo 'maillog')
# Truncate if it's a mail address
USER=${USER%@*}
HOME="/home/e-smith/files/users/$USER" HOME="/home/e-smith/files/users/$USER"
# Stop here if the home dir doesn't exist
if [ \! -d $HOME ]; then
echo "$HOME doesn't exist"
exit 1
fi
MONTH=$(date +%m) MONTH=$(date +%m)
YEAR=$(date +%Y) YEAR=$(date +%Y)

Loading…
Cancel
Save