install_update_dovecot-2.4.sh: support english language in qota warn messages.
This commit is contained in:
@@ -165,8 +165,16 @@ max_userip_connections=24
|
||||
#auth_mechanisms="plain login digest-md5 cram-md5"
|
||||
auth_mechanisms="plain login"
|
||||
|
||||
|
||||
# ---
|
||||
# - Settings for quota warning sript
|
||||
# -
|
||||
# ---
|
||||
|
||||
# msg_language
|
||||
#
|
||||
# possible Vallues are 'en' or 'de'
|
||||
#
|
||||
msg_language=de
|
||||
from_address="o.open <oo@oopen.de>"
|
||||
reply_to="oo@oopen.de"
|
||||
webmailer="https://webmail.oopen.de"
|
||||
|
||||
@@ -1026,6 +1026,13 @@ if [[ "$database" != "postgres" ]] && [[ "$database" != "mysql" ]] ; then
|
||||
fi
|
||||
[[ -n "$dbpassword" ]] || fatal "Parameter "dbpassword" not set."
|
||||
|
||||
lang="${msg_language,,}"
|
||||
if [[ "$lang" =~ ^(en|us|en_us)$ ]]; then
|
||||
msg_language="en"
|
||||
else
|
||||
msg_language="de"
|
||||
fi
|
||||
|
||||
[[ -n "$from_address" ]] || fatal ""Parameter "from_address" not set.""
|
||||
[[ -n "$reply_to" ]] || fatal ""Parameter "reply_to" not set.""
|
||||
[[ -n "$webmailer" ]] || fatal ""Parameter "webmailer" not set.""
|
||||
@@ -9912,6 +9919,46 @@ if [[ $dovecot_major_version -gt 2 ]] \
|
||||
echononl " Create quota warning script.."
|
||||
## - create the user-warning script
|
||||
## -
|
||||
if [[ "${msg_language}" == "en" ]] ; then
|
||||
cat <<EOF >/usr/local/bin/quota-warning.sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# author: zhang huangbin <michaelbibby (at) gmail.com>
|
||||
# purpose: send mail to notify user when his mailbox quota exceeds a
|
||||
# specified limit.
|
||||
# project: iredmail (http://www.iredmail.org/)
|
||||
|
||||
LANG=en_US.UTF-8
|
||||
|
||||
percent=\$1
|
||||
user=\$2
|
||||
|
||||
cat << EOF | /usr/local/dovecot/libexec/dovecot/dovecot-lda -d \${user} -o quota_enforce=no
|
||||
Date: `date +"%a, %e %b %Y %H:%M:%S %z"`
|
||||
From: $from_address
|
||||
Reply-to: $reply_to
|
||||
To:\${user}
|
||||
Subject: Quota warning - mailbox is ${percent}% full
|
||||
content-type: text/plain;
|
||||
charset=utf-8
|
||||
|
||||
Hello!
|
||||
|
||||
Your email inbox
|
||||
\${user}
|
||||
is over \${percent}% full. To continue receiving emails, please delete emails from your inbox on the server.
|
||||
|
||||
You can also use the webmail service:
|
||||
$webmailer
|
||||
|
||||
After deleting emails, please remember to empty the trash folder as well.
|
||||
|
||||
Best regards
|
||||
|
||||
$salutation
|
||||
${_EOF:-EOF}
|
||||
EOF
|
||||
else
|
||||
cat <<EOF >/usr/local/bin/quota-warning.sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@@ -9951,6 +9998,7 @@ Viele Grüße
|
||||
$salutation
|
||||
${_EOF:-EOF}
|
||||
EOF
|
||||
fi
|
||||
if [ "$?" = 0 ]; then
|
||||
echo -e "$rc_done"
|
||||
else
|
||||
@@ -9963,6 +10011,32 @@ EOF
|
||||
echononl " Create quota warn-under script.."
|
||||
## - create the user-warning script
|
||||
## -
|
||||
if [[ "${msg_language}" == "en" ]] ; then
|
||||
cat <<EOF >/usr/local/bin/quota-warn-under.sh
|
||||
cat << EOF | /usr/local/dovecot/libexec/dovecot/dovecot-lda -d \${user} -o quota_enforce=no
|
||||
Date: \`date +"%a, %e %b %Y %H:%M:%S %z"\`
|
||||
From: $from_address
|
||||
Reply-to: $reply_to
|
||||
To:\${user}
|
||||
Subject: Mailbox quota: less than ${percent}% used
|
||||
content-type: text/plain;
|
||||
charset=utf-8
|
||||
|
||||
Your mailbox
|
||||
\${user}
|
||||
can now receive e-mail again.
|
||||
|
||||
Please note that, depending on how much space you have freed, your available storage may fill up again quickly.
|
||||
|
||||
You can check the current usage in your mail client or via the webmailer here:
|
||||
$webmailer
|
||||
|
||||
Best regards
|
||||
|
||||
$salutation
|
||||
${_EOF:-EOF}
|
||||
EOF
|
||||
else
|
||||
cat <<EOF >/usr/local/bin/quota-warn-under.sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@@ -9995,6 +10069,7 @@ Viele Grüße
|
||||
$salutation
|
||||
${_EOF:-EOF}
|
||||
EOF
|
||||
fi
|
||||
if [ "$?" = 0 ]; then
|
||||
echo -e "$rc_done"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user