Handle Bcc being a fully qualified address in rotate script

GLPI #30996
This commit is contained in:
Daniel Berteaud 2018-02-06 16:13:52 +01:00
parent 19722f2507
commit 4d00447448
1 changed files with 8 additions and 0 deletions

View File

@ -11,8 +11,16 @@ if [ "$BCC" != "enabled" -o "$ARCHIVE" != "enabled" ]; then
fi
USER=$(db configuration getprop qpsmtpd BccUser || echo 'maillog')
# Truncate if it's a mail address
USER=${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)
YEAR=$(date +%Y)