Compare commits
7 Commits
05723c0514
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 50bc28dc2a | |||
| b87793cbad | |||
|
|
cc155c578a | ||
| b28b3a8316 | |||
| ecfd630612 | |||
| 68d2bd18b7 | |||
|
|
6521b03aa2 |
@@ -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"
|
||||
|
||||
@@ -115,9 +115,11 @@ DEFAULT_ADMIN_EMAIL="argus@oopen.de"
|
||||
|
||||
# - Is this a systemd system?
|
||||
# -
|
||||
if [[ "X`which systemd`" = "X" ]]; then
|
||||
systemd_exists=false
|
||||
else
|
||||
systemd_exists=false
|
||||
systemd=$(which systemd)
|
||||
systemctl=$(which systemctl)
|
||||
|
||||
if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then
|
||||
systemd_exists=true
|
||||
fi
|
||||
|
||||
|
||||
@@ -154,9 +154,11 @@ QUARANTINE_ADMIN=$DEFAULT_QUARANTINE_ADMIN
|
||||
|
||||
# - Is this a systemd system?
|
||||
# -
|
||||
if [[ "X`which systemd`" = "X" ]]; then
|
||||
systemd_exists=false
|
||||
else
|
||||
systemd_exists=false
|
||||
systemd=$(which systemd)
|
||||
systemctl=$(which systemctl)
|
||||
|
||||
if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then
|
||||
systemd_exists=true
|
||||
fi
|
||||
|
||||
@@ -4315,6 +4317,23 @@ if (-r \$policy_banks_file) {
|
||||
\$final_bad_header_destiny = D_PASS;
|
||||
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Admin E-Mails / Warnungen direct von AMaViS (nicht DSN- oder Bounce-Mails)
|
||||
# ----------------------------------------------------------
|
||||
|
||||
# Bemerkung:
|
||||
# *nochmal*: das hat nichts mit den eigentlichen DSN-/Bounce-Mails zu tun.
|
||||
|
||||
\$virus_admin = undef;
|
||||
\$spam_admin = undef;
|
||||
|
||||
\$warnvirusrecip = 0;
|
||||
\$warnbannedrecip = 0;
|
||||
\$warnbannedsender = 0;
|
||||
\$warnbadhrecip = 0;
|
||||
\$warn_offsite = 0;
|
||||
|
||||
|
||||
|
||||
# Bypass spam checking for trusted networks using mynetworks
|
||||
#
|
||||
@@ -4989,19 +5008,6 @@ EOF
|
||||
EOF
|
||||
fi
|
||||
|
||||
if ${listen_on_additional_smtp_port} ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
${additional_smtp_port} inet n - y - - smtpd
|
||||
-o smtpd_proxy_filter=127.0.0.1:10024
|
||||
-o content_filter=
|
||||
EOF
|
||||
if [[ "$SASL_AUTH_ENABLED" = "no" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_sasl_auth_enable=no
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! $submission_present && ! $smtps_present && ! $localhost_10025_present ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
localhost:10025 inet n - y - - smtpd
|
||||
@@ -5016,13 +5022,9 @@ localhost:10025 inet n - y - - smtpd
|
||||
-o mynetworks=127.0.0.0/8,[::1]/128
|
||||
-o receive_override_options=no_unknown_recipient_checks
|
||||
EOF
|
||||
if [[ -n "$(which opendkim)" && -n "$(which opendmarc)" ]] ; then
|
||||
if [[-n "$(which opendmarc)" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_milters=local:/opendkim/opendkim.sock,local:/opendmarc/opendmarc.sock
|
||||
EOF
|
||||
elif [[ -n "$(which opendkim)" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_milters=local:/opendkim/opendkim.sock
|
||||
-o smtpd_milters=local:/opendmarc/opendmarc.sock
|
||||
EOF
|
||||
fi
|
||||
cat >> $postfix_master_cf << EOF
|
||||
@@ -5033,8 +5035,26 @@ EOF
|
||||
continue
|
||||
fi
|
||||
|
||||
if ${listen_on_additional_smtp_port} \
|
||||
&& echo "$_line" | grep -i -E "^\s*${additional_smtp_port}\s+inet" > /dev/null 2>&1 ; then
|
||||
_found=true
|
||||
cat >> $postfix_master_cf << EOF
|
||||
${additional_smtp_port} inet n - y - - smtpd
|
||||
-o smtpd_proxy_filter=127.0.0.1:10024
|
||||
-o content_filter=
|
||||
EOF
|
||||
if [[ "$SASL_AUTH_ENABLED" = "no" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_sasl_auth_enable=no
|
||||
EOF
|
||||
fi
|
||||
|
||||
if $submission_present && echo "$_line" | grep -i -E "^^submission\s+" > /dev/null 2>&1 ; then
|
||||
continue
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if $submission_present && echo "$_line" | grep -i -E "^submission\s+" > /dev/null 2>&1 ; then
|
||||
_found=true
|
||||
cat >> $postfix_master_cf << EOF
|
||||
submission inet n - y - 20 smtpd
|
||||
@@ -5042,6 +5062,13 @@ submission inet n - y - 20 smtpd
|
||||
-o smtpd_tls_security_level=encrypt
|
||||
-o smtpd_sasl_auth_enable=yes
|
||||
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
|
||||
EOF
|
||||
if [[ -n "$(which opendkim)" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_milters=local:/opendkim/opendkim.sock
|
||||
EOF
|
||||
fi
|
||||
cat >> $postfix_master_cf << EOF
|
||||
#-o milter_macro_daemon_name=ORIGINATING
|
||||
EOF
|
||||
if ! $smtps_present ; then
|
||||
@@ -5059,13 +5086,9 @@ localhost:10025 inet n - y - - smtpd
|
||||
-o mynetworks=127.0.0.0/8,[::1]/128
|
||||
-o receive_override_options=no_unknown_recipient_checks
|
||||
EOF
|
||||
if [[ -n "$(which opendkim)" && -n "$(which opendmarc)" ]] ; then
|
||||
if [[ -n "$(which opendmarc)" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_milters=local:/opendkim/opendkim.sock,local:/opendmarc/opendmarc.sock
|
||||
EOF
|
||||
elif [[ -n "$(which opendkim)" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_milters=local:/opendkim/opendkim.sock
|
||||
-o smtpd_milters=local:/opendmarc/opendmarc.sock
|
||||
EOF
|
||||
fi
|
||||
cat >> $postfix_master_cf << EOF
|
||||
@@ -5076,9 +5099,9 @@ EOF
|
||||
if ! $amavisfeed_present ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
amavisfeed unix - - n - 20 lmtp
|
||||
-o smtp_data_done_timeout=1200
|
||||
-o smtp_send_xforward_command=yes
|
||||
-o disable_dns_lookups=yes
|
||||
-o smtp_data_done_timeout=1200
|
||||
-o smtp_send_xforward_command=yes
|
||||
-o disable_dns_lookups=yes
|
||||
EOF
|
||||
fi
|
||||
fi # if ! $smtps_present
|
||||
@@ -5092,11 +5115,18 @@ EOF
|
||||
_found=true
|
||||
cat >> $postfix_master_cf << EOF
|
||||
smtps inet n - y - - smtpd
|
||||
-o content_filter=amavisfeed:[127.0.0.1]:10024
|
||||
-o smtpd_tls_wrappermode=yes
|
||||
-o smtpd_sasl_auth_enable=yes
|
||||
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
|
||||
#-o milter_macro_daemon_name=ORIGINATING
|
||||
-o content_filter=amavisfeed:[127.0.0.1]:10024
|
||||
-o smtpd_tls_wrappermode=yes
|
||||
-o smtpd_sasl_auth_enable=yes
|
||||
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
|
||||
EOF
|
||||
if [[ -n "$(which opendkim)" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_milters=local:/opendkim/opendkim.sock
|
||||
EOF
|
||||
fi
|
||||
cat >> $postfix_master_cf << EOF
|
||||
#-o milter_macro_daemon_name=ORIGINATING
|
||||
EOF
|
||||
|
||||
if ! $localhost_10025_present ; then
|
||||
@@ -5113,15 +5143,11 @@ localhost:10025 inet n - y - - smtpd
|
||||
-o mynetworks=127.0.0.0/8,[::1]/128
|
||||
-o receive_override_options=no_unknown_recipient_checks
|
||||
EOF
|
||||
if [[ -n "$(which opendkim)" && -n "$(which opendmarc)" ]] ; then
|
||||
if [[ -n "$(which opendmarc)" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_milters=local:/opendkim/opendkim.sock,local:/opendmarc/opendmarc.sock
|
||||
-o smtpd_milters=local:/opendmarc/opendmarc.sock
|
||||
EOF
|
||||
elif [[ -n "$(which opendkim)" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_milters=local:/opendkim/opendkim.sock
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
cat >> $postfix_master_cf << EOF
|
||||
#-o mynetworks=127.0.0.0/8,[::1]/128,${IPV4}/32
|
||||
EOF
|
||||
@@ -5130,9 +5156,9 @@ EOF
|
||||
if ! $amavisfeed_present ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
amavisfeed unix - - n - 20 lmtp
|
||||
-o smtp_data_done_timeout=1200
|
||||
-o smtp_send_xforward_command=yes
|
||||
-o disable_dns_lookups=yes
|
||||
-o smtp_data_done_timeout=1200
|
||||
-o smtp_send_xforward_command=yes
|
||||
-o disable_dns_lookups=yes
|
||||
EOF
|
||||
fi
|
||||
|
||||
@@ -5156,16 +5182,12 @@ localhost:10025 inet n - y - - smtpd
|
||||
-o mynetworks=127.0.0.0/8,[::1]/128
|
||||
-o receive_override_options=no_unknown_recipient_checks
|
||||
EOF
|
||||
if [[ -n "$(which opendkim)" && -n "$(which opendmarc)" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_milters=local:/opendkim/opendkim.sock,local:/opendmarc/opendmarc.sock
|
||||
EOF
|
||||
elif [[ -n "$(which opendkim)" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_milters=local:/opendkim/opendkim.sock
|
||||
EOF
|
||||
fi
|
||||
if [[ -n "$(which opendmarc)" ]] ; then
|
||||
cat >> $postfix_master_cf << EOF
|
||||
-o smtpd_milters=local:/opendmarc/opendmarc.sock
|
||||
EOF
|
||||
fi
|
||||
cat >> $postfix_master_cf << EOF
|
||||
#-o mynetworks=127.0.0.0/8,[::1]/128,${IPV4}/32
|
||||
EOF
|
||||
continue
|
||||
@@ -5175,9 +5197,9 @@ EOF
|
||||
_found=true
|
||||
cat >> $postfix_master_cf << EOF
|
||||
amavisfeed unix - - n - 20 lmtp
|
||||
-o smtp_data_done_timeout=1200
|
||||
-o smtp_send_xforward_command=yes
|
||||
-o disable_dns_lookups=yes
|
||||
-o smtp_data_done_timeout=1200
|
||||
-o smtp_send_xforward_command=yes
|
||||
-o disable_dns_lookups=yes
|
||||
EOF
|
||||
continue
|
||||
fi
|
||||
|
||||
@@ -94,9 +94,11 @@ echo_skipped() {
|
||||
|
||||
# - Is 'systemd' supported on this system
|
||||
# -
|
||||
if [ "X`which systemd`" = "X" ]; then
|
||||
SYSTEMD_EXISTS=false
|
||||
else
|
||||
SYSTEMD_EXISTS=false
|
||||
systemd=$(which systemd)
|
||||
systemctl=$(which systemctl)
|
||||
|
||||
if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then
|
||||
SYSTEMD_EXISTS=true
|
||||
fi
|
||||
|
||||
|
||||
@@ -116,9 +116,11 @@ echo_skipped() {
|
||||
|
||||
# - Is 'systemd' supported on this system
|
||||
# -
|
||||
if [ "X`which systemd`" = "X" ]; then
|
||||
SYSTEMD_EXISTS=false
|
||||
else
|
||||
SYSTEMD_EXISTS=false
|
||||
systemd=$(which systemd)
|
||||
systemctl=$(which systemctl)
|
||||
|
||||
if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then
|
||||
SYSTEMD_EXISTS=true
|
||||
fi
|
||||
|
||||
|
||||
@@ -136,9 +136,11 @@ DEFAULT_INSTALL_DMARC_REPORT_SUPPORT=false
|
||||
|
||||
# - Is this a systemd system?
|
||||
# -
|
||||
if [[ "X`which systemd`" = "X" ]]; then
|
||||
systemd_exists=false
|
||||
else
|
||||
systemd_exists=false
|
||||
systemd=$(which systemd)
|
||||
systemctl=$(which systemctl)
|
||||
|
||||
if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then
|
||||
systemd_exists=true
|
||||
fi
|
||||
|
||||
|
||||
@@ -136,9 +136,11 @@ DEFAULT_REWRITE_SENDER_DOMAIN=None
|
||||
|
||||
# - Is this a systemd system?
|
||||
# -
|
||||
if [[ "X`which systemd`" = "X" ]]; then
|
||||
systemd_exists=false
|
||||
else
|
||||
systemd_exists=false
|
||||
systemd=$(which systemd)
|
||||
systemctl=$(which systemctl)
|
||||
|
||||
if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then
|
||||
systemd_exists=true
|
||||
fi
|
||||
|
||||
|
||||
@@ -65,6 +65,14 @@ echo_skipped() {
|
||||
echo -e "\033[80G[ \033[33m\033[1mskipped\033[m ]"
|
||||
}
|
||||
|
||||
systemd_exists=false
|
||||
systemd=$(which systemd)
|
||||
systemctl=$(which systemctl)
|
||||
|
||||
if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then
|
||||
systemd_exists=true
|
||||
fi
|
||||
|
||||
## - Install Postfix Firewall Daemon from debian packages system
|
||||
## -
|
||||
echononl " Install Postfix Firewall Daemon from debian packages system"
|
||||
|
||||
@@ -964,9 +964,11 @@ delete_variable_with_comments() {
|
||||
|
||||
# - Support systemd ?
|
||||
# -
|
||||
if [[ "X$(which systemd)" = "X" ]]; then
|
||||
SYSTEMD_EXISTS=false
|
||||
else
|
||||
SYSTEMD_EXISTS=false
|
||||
systemd=$(which systemd)
|
||||
systemctl=$(which systemctl)
|
||||
|
||||
if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then
|
||||
SYSTEMD_EXISTS=true
|
||||
fi
|
||||
|
||||
@@ -1024,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.""
|
||||
@@ -7587,9 +7596,10 @@ if [[ $dovecot_major_version -gt 2 ]] \
|
||||
read -r -d '' NEW_BLOCK <<EOF
|
||||
|
||||
sieve_script personal {
|
||||
driver = file
|
||||
path = ~/sieve
|
||||
active_path = ~/.dovecot.sieve
|
||||
type = personal # kann man schreiben, ist aber Default
|
||||
driver = file
|
||||
path = ~/sieve
|
||||
active_path = ~/.dovecot.sieve
|
||||
}
|
||||
EOF
|
||||
replace_or_append_code_block "sieve_script personal" "${NEW_BLOCK}" "${_conf_file}" >> "${log_file}" 2>&1
|
||||
@@ -7604,6 +7614,8 @@ EOF
|
||||
# personal
|
||||
# --------
|
||||
#
|
||||
# ** Used by both the Sieve plugin and the ManageSieve protocol **
|
||||
#
|
||||
# The personal storage serves as the user's main personal storage. Although more than a single
|
||||
# personal storage can be defined, only the first one listed in the configuration is used.
|
||||
#
|
||||
@@ -7626,9 +7638,10 @@ EOF
|
||||
# no default script is executed.
|
||||
|
||||
sieve_script personal {
|
||||
driver = file
|
||||
path = ~/sieve
|
||||
active_path = ~/.dovecot.sieve
|
||||
type = personal # kann man schreiben, ist aber Default
|
||||
driver = file
|
||||
path = ~/sieve
|
||||
active_path = ~/.dovecot.sieve
|
||||
}
|
||||
EOF
|
||||
if [[ $? -gt 0 ]]; then
|
||||
@@ -7638,16 +7651,17 @@ EOF
|
||||
fi
|
||||
|
||||
|
||||
if grep -qE "^\s*sieve_script\s+before\s*{" "${_conf_file}"; then
|
||||
if grep -qE "^\s*sieve_script\s+before_spam\s*{" "${_conf_file}"; then
|
||||
|
||||
read -r -d '' NEW_BLOCK <<EOF
|
||||
|
||||
sieve_script before {
|
||||
sieve_script before_spam {
|
||||
type = before
|
||||
driver = file
|
||||
path = /usr/local/dovecot/etc/dovecot/sieve/
|
||||
}
|
||||
EOF
|
||||
replace_or_append_code_block "sieve_script before" "${NEW_BLOCK}" "${_conf_file}" >> "${log_file}" 2>&1
|
||||
replace_or_append_code_block "sieve_script before_spam" "${NEW_BLOCK}" "${_conf_file}" >> "${log_file}" 2>&1
|
||||
if [[ $? -gt 0 ]]; then
|
||||
_failed=true
|
||||
fi
|
||||
@@ -7676,7 +7690,8 @@ EOF
|
||||
# A before storage behaves identical to an after storage, except the contained script or
|
||||
# scripts are run before user's personal script (instead of after).
|
||||
|
||||
sieve_script before {
|
||||
sieve_script before_spam {
|
||||
type = before
|
||||
driver = file
|
||||
path = /usr/local/dovecot/etc/dovecot/sieve/
|
||||
}
|
||||
@@ -7688,16 +7703,17 @@ EOF
|
||||
fi
|
||||
|
||||
|
||||
if grep -qE "^\s*sieve_script\s+global\s*{" "${_conf_file}"; then
|
||||
if grep -qE "^\s*sieve_script\s+global_includes\s*{" "${_conf_file}"; then
|
||||
|
||||
read -r -d '' NEW_BLOCK <<EOF
|
||||
|
||||
sieve_script global {
|
||||
driver = file
|
||||
path = /usr/local/dovecot/etc/dovecot/sieve/global/
|
||||
sieve_script global_includes {
|
||||
type = global
|
||||
driver = file
|
||||
path = /usr/local/dovecot/etc/dovecot/sieve/global/
|
||||
}
|
||||
EOF
|
||||
replace_or_append_code_block "sieve_script global" "${NEW_BLOCK}" "${_conf_file}" >> "${log_file}" 2>&1
|
||||
replace_or_append_code_block "sieve_script global_includes" "${NEW_BLOCK}" "${_conf_file}" >> "${log_file}" 2>&1
|
||||
if [[ $? -gt 0 ]]; then
|
||||
_failed=true
|
||||
fi
|
||||
@@ -7746,9 +7762,10 @@ EOF
|
||||
# storages are defined in the configuration until the script is found. The order can be
|
||||
# overridden by the sieve_script_precedence setting.
|
||||
|
||||
sieve_script global {
|
||||
driver = file
|
||||
path = /usr/local/dovecot/etc/dovecot/sieve/global/
|
||||
sieve_script global_includes {
|
||||
type = global
|
||||
driver = file
|
||||
path = /usr/local/dovecot/etc/dovecot/sieve/global/
|
||||
}
|
||||
EOF
|
||||
if [[ $? -gt 0 ]]; then
|
||||
@@ -9902,7 +9919,47 @@ if [[ $dovecot_major_version -gt 2 ]] \
|
||||
echononl " Create quota warning script.."
|
||||
## - create the user-warning script
|
||||
## -
|
||||
cat <<EOF >/usr/local/bin/quota-warning.sh
|
||||
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
|
||||
|
||||
# author: zhang huangbin <michaelbibby (at) gmail.com>
|
||||
@@ -9941,6 +9998,7 @@ Viele Grüße
|
||||
$salutation
|
||||
${_EOF:-EOF}
|
||||
EOF
|
||||
fi
|
||||
if [ "$?" = 0 ]; then
|
||||
echo -e "$rc_done"
|
||||
else
|
||||
@@ -9953,7 +10011,33 @@ EOF
|
||||
echononl " Create quota warn-under script.."
|
||||
## - create the user-warning script
|
||||
## -
|
||||
cat <<EOF >/usr/local/bin/quota-warn-under.sh
|
||||
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
|
||||
|
||||
percent=\$1
|
||||
@@ -9985,6 +10069,7 @@ Viele Grüße
|
||||
$salutation
|
||||
${_EOF:-EOF}
|
||||
EOF
|
||||
fi
|
||||
if [ "$?" = 0 ]; then
|
||||
echo -e "$rc_done"
|
||||
else
|
||||
@@ -10871,24 +10956,27 @@ EOF
|
||||
replace_or_append_code_block "protocol sieve" "${NEW_BLOCK}" "${_conf_file}" || _failed=true
|
||||
|
||||
|
||||
read -r -d '' NEW_BLOCK <<'EOF'
|
||||
sieve_script personal {
|
||||
path = ~/sieve
|
||||
active_path = ~/.dovecot.sieve
|
||||
}
|
||||
EOF
|
||||
if grep -qE "^\s*sieve_script\s+personal\s+{" "${_conf_file}"; then
|
||||
|
||||
replace_code_block "sieve_script personal" "${NEW_BLOCK}" "${_conf_file}" || _failed=true
|
||||
|
||||
else
|
||||
|
||||
cat <<EOF >> "${_conf_file}" || _failed=true
|
||||
|
||||
# Used by both the Sieve plugin and the ManageSieve protocol
|
||||
${NEW_BLOCK}
|
||||
EOF
|
||||
fi
|
||||
# read -r -d '' NEW_BLOCK <<'EOF'
|
||||
#sieve_script personal {
|
||||
# type = personal # kann man schreiben, ist aber Default
|
||||
# type = personal
|
||||
# driver = file
|
||||
# path = ~/sieve
|
||||
# active_path = ~/.dovecot.sieve
|
||||
#}
|
||||
#EOF
|
||||
# if grep -qE "^\s*sieve_script\s+personal\s+{" "${_conf_file}"; then
|
||||
#
|
||||
# replace_code_block "sieve_script personal" "${NEW_BLOCK}" "${_conf_file}" || _failed=true
|
||||
#
|
||||
# else
|
||||
#
|
||||
# cat <<EOF >> "${_conf_file}" || _failed=true
|
||||
#
|
||||
## Used by both the Sieve plugin and the ManageSieve protocol
|
||||
#${NEW_BLOCK}
|
||||
#EOF
|
||||
# fi
|
||||
|
||||
|
||||
if ! $_failed ; then
|
||||
|
||||
@@ -148,9 +148,11 @@ detect_os_1 () {
|
||||
|
||||
# - Support systemd ?
|
||||
# -
|
||||
if [[ "X$(which systemd)" = "X" ]]; then
|
||||
SYSTEMD_EXISTS=false
|
||||
else
|
||||
SYSTEMD_EXISTS=false
|
||||
systemd=$(which systemd)
|
||||
systemctl=$(which systemctl)
|
||||
|
||||
if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then
|
||||
SYSTEMD_EXISTS=true
|
||||
fi
|
||||
|
||||
|
||||
@@ -95,6 +95,16 @@ echo_skipped() {
|
||||
echo -e "\033[75G[ \033[30m\033[1mskipped\033[m ]"
|
||||
}
|
||||
|
||||
# -Is systemd supported on this system?
|
||||
# -
|
||||
systemd_supported=false
|
||||
systemd=$(which systemd)
|
||||
systemctl=$(which systemctl)
|
||||
|
||||
if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then
|
||||
systemd_supported=true
|
||||
fi
|
||||
|
||||
|
||||
if [ "$POSTFIX_DB_TYPE" = "postgres" -o "$POSTFIX_DB_TYPE" = "postgresql" -o "$POSTFIX_DB_TYPE" = "pgsql" -o "$POSTFIX_DB_TYPE" = "psql" ];then
|
||||
POSTFIX_DB_TYPE=pgsql
|
||||
|
||||
@@ -182,9 +182,11 @@ fi
|
||||
|
||||
# - Is this a systemd system?
|
||||
# -
|
||||
if [[ "X`which systemd`" = "X" ]]; then
|
||||
systemd_exists=false
|
||||
else
|
||||
systemd_exists=false
|
||||
systemd=$(which systemd)
|
||||
systemctl=$(which systemctl)
|
||||
|
||||
if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then
|
||||
systemd_exists=true
|
||||
fi
|
||||
|
||||
|
||||
@@ -126,9 +126,11 @@ DEFAULT_SASL_AUTH=false
|
||||
|
||||
# - Is this a systemd system?
|
||||
# -
|
||||
if [[ "X`which systemd`" = "X" ]]; then
|
||||
systemd_exists=false
|
||||
else
|
||||
systemd_exists=false
|
||||
systemd=$(which systemd)
|
||||
systemctl=$(which systemctl)
|
||||
|
||||
if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then
|
||||
systemd_exists=true
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user