diff --git a/install_update_dovecot-2.4.sh b/install_update_dovecot-2.4.sh index 4c3f467..69fbac2 100755 --- a/install_update_dovecot-2.4.sh +++ b/install_update_dovecot-2.4.sh @@ -4043,6 +4043,10 @@ if [[ $dovecot_major_version -gt 2 ]] \ # - - the always disabled services (DISABLED_MAIL_PROTOCOLS, e.g. # - submission) are set to 'no' as well. # - + # - The 'service' blocks (10-master.conf) of imap, pop3 and sieve are always + # - written. So a protocol can later be switched on/off simply by changing + # - 'yes'/'no' here and restarting dovecot. + # - # - Example (mail_protocols="imap sieve"): # - # - protocols { @@ -4720,7 +4724,7 @@ if [[ $dovecot_major_version -gt 2 ]] \ # process_min_avail = 16 # } # - # # only if mail service 'pop3' is selected - otherwise removed + # # always written - pop3 is switched on/off in 'protocols' (dovecot.conf) # service pop3-login { # inet_listener pop3 { # address = $pop_listener_adresses @@ -4764,7 +4768,7 @@ if [[ $dovecot_major_version -gt 2 ]] \ # #process_limit = 1024 # } # - # # only if mail service 'pop3' is selected - otherwise removed + # # always written - pop3 is switched on/off in 'protocols' (dovecot.conf) # service pop3 { # # # tell imap to do post-login lookup using a socket called "imap-postlogin" @@ -4879,12 +4883,12 @@ EOF # - service pop3-login # - - # - Only if mail service 'pop3' is selected (mail_protocols). Otherwise an - # - existing block (e.g. from the shipped example configuration) will be - # - removed. + # - Always written - also if mail service 'pop3' is not selected. Dovecot + # - only starts the services of enabled protocols (see 'protocols' block in + # - dovecot.conf). So pop3 can be switched on/off simply by setting + # - 'pop3 = yes|no' there - the service configuration is already in place. # - - if mail_protocol_enabled pop3 ; then - read -r -d '' NEW_BLOCK <> "${log_file}" 2>&1 - if [[ $? -gt 0 ]]; then - _failed=true - fi - else - delete_code_block_with_comments "service pop3-login" "${_conf_file}" >> "${log_file}" 2>&1 - if [[ $? -gt 1 ]]; then - _failed=true - fi + replace_or_append_code_block "service pop3-login" "${NEW_BLOCK}" "${_conf_file}" >> "${log_file}" 2>&1 + if [[ $? -gt 0 ]]; then + _failed=true fi # - service submission-login @@ -4964,11 +4962,9 @@ EOF # - service pop3 # - - # - Only if mail service 'pop3' is selected (mail_protocols), otherwise - # - remove an existing block. + # - Always written (see 'service pop3-login' above) # - - if mail_protocol_enabled pop3 ; then - read -r -d '' NEW_BLOCK <> "${log_file}" 2>&1 - if [[ $? -gt 0 ]]; then - _failed=true - fi - else - delete_code_block_with_comments "service pop3" "${_conf_file}" >> "${log_file}" 2>&1 - if [[ $? -gt 1 ]]; then - _failed=true - fi + replace_or_append_code_block "service pop3" "${NEW_BLOCK}" "${_conf_file}" >> "${log_file}" 2>&1 + if [[ $? -gt 0 ]]; then + _failed=true fi # - service submission @@ -10627,13 +10617,7 @@ EOF _failed=true fi - # - service pop3 (post-login) - only if mail service 'pop3' is selected - # - - # - Otherwise there is nothing to do here: the block was already removed - # - while editing 10-master.conf before (see "service pop3" above). - # - - if mail_protocol_enabled pop3 ; then - read -r -d '' NEW_BLOCK <> "${log_file}" 2>&1 - if [[ $? -gt 0 ]]; then - _failed=true - fi + replace_or_append_code_block "service pop3" "${NEW_BLOCK}" "${_conf_file}" >> "${log_file}" 2>&1 + if [[ $? -gt 0 ]]; then + _failed=true fi read -r -d '' NEW_BLOCK <<'EOF'