Compare commits

...
1 Commits
Author SHA1 Message Date
chrisandClaude Opus 5.5 b2c55d57b8 install_update_dovecot-2.4.sh: always write pop3 service blocks
Write 'service pop3-login' and 'service pop3' (also post-login) again
regardless of the selected mail services - like for imap and sieve.
Dovecot only starts services of enabled protocols, so a protocol can
be switched on/off simply via 'yes'/'no' in the 'protocols' block of
dovecot.conf followed by a restart.

Only dovecot's submission service blocks are still removed
(submission is provided by postfix).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:43:46 +01:00
+23 -40
View File
@@ -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 <<EOF
read -r -d '' NEW_BLOCK <<EOF
service pop3-login {
inet_listener pop3 {
@@ -4899,15 +4903,9 @@ service pop3-login {
}
}
EOF
replace_or_append_code_block "service pop3-login" "${NEW_BLOCK}" "${_conf_file}" >> "${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 <<EOF
read -r -d '' NEW_BLOCK <<EOF
service pop3 {
# tell imap to do post-login lookup using a socket called "imap-postlogin"
@@ -4978,15 +4974,9 @@ service pop3 {
#process_limit = 1024
}
EOF
replace_or_append_code_block "service pop3" "${NEW_BLOCK}" "${_conf_file}" >> "${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 <<EOF
read -r -d '' NEW_BLOCK <<EOF
service pop3 {
# tell imap to do post-login lookup using a socket called "imap-postlogin"
@@ -10643,10 +10627,9 @@ service pop3 {
#process_limit = 1024
}
EOF
replace_or_append_code_block "service pop3" "${NEW_BLOCK}" "${_conf_file}" >> "${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'