install_update_dovecot-2.4.sh: adjust sieve configuration.
This commit is contained in:
@@ -7587,6 +7587,7 @@ if [[ $dovecot_major_version -gt 2 ]] \
|
|||||||
read -r -d '' NEW_BLOCK <<EOF
|
read -r -d '' NEW_BLOCK <<EOF
|
||||||
|
|
||||||
sieve_script personal {
|
sieve_script personal {
|
||||||
|
type = personal # kann man schreiben, ist aber Default
|
||||||
driver = file
|
driver = file
|
||||||
path = ~/sieve
|
path = ~/sieve
|
||||||
active_path = ~/.dovecot.sieve
|
active_path = ~/.dovecot.sieve
|
||||||
@@ -7604,6 +7605,8 @@ EOF
|
|||||||
# personal
|
# 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
|
# 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.
|
# personal storage can be defined, only the first one listed in the configuration is used.
|
||||||
#
|
#
|
||||||
@@ -7626,6 +7629,7 @@ EOF
|
|||||||
# no default script is executed.
|
# no default script is executed.
|
||||||
|
|
||||||
sieve_script personal {
|
sieve_script personal {
|
||||||
|
type = personal # kann man schreiben, ist aber Default
|
||||||
driver = file
|
driver = file
|
||||||
path = ~/sieve
|
path = ~/sieve
|
||||||
active_path = ~/.dovecot.sieve
|
active_path = ~/.dovecot.sieve
|
||||||
@@ -7638,16 +7642,17 @@ EOF
|
|||||||
fi
|
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
|
read -r -d '' NEW_BLOCK <<EOF
|
||||||
|
|
||||||
sieve_script before {
|
sieve_script before_spam {
|
||||||
|
type = before
|
||||||
driver = file
|
driver = file
|
||||||
path = /usr/local/dovecot/etc/dovecot/sieve/
|
path = /usr/local/dovecot/etc/dovecot/sieve/
|
||||||
}
|
}
|
||||||
EOF
|
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
|
if [[ $? -gt 0 ]]; then
|
||||||
_failed=true
|
_failed=true
|
||||||
fi
|
fi
|
||||||
@@ -7676,7 +7681,8 @@ EOF
|
|||||||
# A before storage behaves identical to an after storage, except the contained script or
|
# 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).
|
# scripts are run before user's personal script (instead of after).
|
||||||
|
|
||||||
sieve_script before {
|
sieve_script before_spam {
|
||||||
|
type = before
|
||||||
driver = file
|
driver = file
|
||||||
path = /usr/local/dovecot/etc/dovecot/sieve/
|
path = /usr/local/dovecot/etc/dovecot/sieve/
|
||||||
}
|
}
|
||||||
@@ -7688,16 +7694,17 @@ EOF
|
|||||||
fi
|
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
|
read -r -d '' NEW_BLOCK <<EOF
|
||||||
|
|
||||||
sieve_script global {
|
sieve_script global_includes {
|
||||||
|
type = global
|
||||||
driver = file
|
driver = file
|
||||||
path = /usr/local/dovecot/etc/dovecot/sieve/global/
|
path = /usr/local/dovecot/etc/dovecot/sieve/global/
|
||||||
}
|
}
|
||||||
EOF
|
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
|
if [[ $? -gt 0 ]]; then
|
||||||
_failed=true
|
_failed=true
|
||||||
fi
|
fi
|
||||||
@@ -7746,7 +7753,8 @@ EOF
|
|||||||
# storages are defined in the configuration until the script is found. The order can be
|
# storages are defined in the configuration until the script is found. The order can be
|
||||||
# overridden by the sieve_script_precedence setting.
|
# overridden by the sieve_script_precedence setting.
|
||||||
|
|
||||||
sieve_script global {
|
sieve_script global_includes {
|
||||||
|
type = global
|
||||||
driver = file
|
driver = file
|
||||||
path = /usr/local/dovecot/etc/dovecot/sieve/global/
|
path = /usr/local/dovecot/etc/dovecot/sieve/global/
|
||||||
}
|
}
|
||||||
@@ -10871,24 +10879,27 @@ EOF
|
|||||||
replace_or_append_code_block "protocol sieve" "${NEW_BLOCK}" "${_conf_file}" || _failed=true
|
replace_or_append_code_block "protocol sieve" "${NEW_BLOCK}" "${_conf_file}" || _failed=true
|
||||||
|
|
||||||
|
|
||||||
read -r -d '' NEW_BLOCK <<'EOF'
|
# read -r -d '' NEW_BLOCK <<'EOF'
|
||||||
sieve_script personal {
|
#sieve_script personal {
|
||||||
path = ~/sieve
|
# type = personal # kann man schreiben, ist aber Default
|
||||||
active_path = ~/.dovecot.sieve
|
# type = personal
|
||||||
}
|
# driver = file
|
||||||
EOF
|
# path = ~/sieve
|
||||||
if grep -qE "^\s*sieve_script\s+personal\s+{" "${_conf_file}"; then
|
# active_path = ~/.dovecot.sieve
|
||||||
|
#}
|
||||||
replace_code_block "sieve_script personal" "${NEW_BLOCK}" "${_conf_file}" || _failed=true
|
#EOF
|
||||||
|
# if grep -qE "^\s*sieve_script\s+personal\s+{" "${_conf_file}"; then
|
||||||
else
|
#
|
||||||
|
# replace_code_block "sieve_script personal" "${NEW_BLOCK}" "${_conf_file}" || _failed=true
|
||||||
cat <<EOF >> "${_conf_file}" || _failed=true
|
#
|
||||||
|
# else
|
||||||
# Used by both the Sieve plugin and the ManageSieve protocol
|
#
|
||||||
${NEW_BLOCK}
|
# cat <<EOF >> "${_conf_file}" || _failed=true
|
||||||
EOF
|
#
|
||||||
fi
|
## Used by both the Sieve plugin and the ManageSieve protocol
|
||||||
|
#${NEW_BLOCK}
|
||||||
|
#EOF
|
||||||
|
# fi
|
||||||
|
|
||||||
|
|
||||||
if ! $_failed ; then
|
if ! $_failed ; then
|
||||||
|
|||||||
Reference in New Issue
Block a user