diff --git a/install_postfix_advanced.sh b/install_postfix_advanced.sh index d9fee7c..b265da4 100755 --- a/install_postfix_advanced.sh +++ b/install_postfix_advanced.sh @@ -1539,6 +1539,7 @@ cat <> /etc/postfix/main.cf ## - ## - using dovecot lda ## - virtual_transport = dovecot +## - dovecot_destination_recipient_limit = 1 ## - ## - using dovecot's lmtp service ## - virtual_transport = lmtp:unix:private/dovecot-lmtp diff --git a/install_update_dovecot.sh b/install_update_dovecot.sh index 91ed69b..00fd51c 100755 --- a/install_update_dovecot.sh +++ b/install_update_dovecot.sh @@ -2797,45 +2797,100 @@ else fi -#if $_new ; then -# -# ## - /etc/postfix/main.cf -# ## - -# ## - comment in: -# ## - #virtual_transport = dovecot -# ## - -# ## - change: -# ## - smtpd_sasl_auth_enable = yes -# ## - smtpd_sasl_type = dovecot -# ## - smtpd_sasl_path = private/dovecot-auth -# ## - virtual_transport = lmtp:unix:private/dovecot-lmtp -# _failed=false -# echononl "\tAdjust /etc/postfix/main.cf" -# perl -i -n -p -e "s#^(\s*)(smtpd_sasl_auth_enable\ *=.*)#smtpd_sasl_auth_enable = yes#" \ -# /etc/postfix/main.cf || _failed=true -# #perl -i -n -p -e "s#^(\s*)(smtpd_sasl_type\ *=.*)#\1\#\2\n\1smtpd_sasl_type = dovecot#" \ -# perl -i -n -p -e "s#^(\s*)(smtpd_sasl_type\ *=.*)#smtpd_sasl_type = dovecot#" \ -# /etc/postfix/main.cf || _failed=true -# #perl -i -n -p -e "s#^(\s*)(smtpd_sasl_path\ *=.*)#\1\#\2\n\1smtpd_sasl_path = private/dovecot-auth#" \ -# # /etc/postfix/main.cf || _failed=true -# perl -i -n -p -e "s#^(\s*)(smtpd_sasl_path\ *=.*)#smtpd_sasl_path = private/dovecot-auth#" \ -# /etc/postfix/main.cf || _failed=true -# -# -# -# #perl -i -n -p -e "s#^(\s*)(virtual_transport\ *=.*)#\1\#\2\n\1virtual_transport = lmtp:unix:private/dovecot-lmtp#" \ -# # /etc/postfix/main.cf || _failed=true -# perl -i -n -p -e "s#^(\s*)(virtual_transport\ *=.*)#virtual_transport = lmtp:unix:private/dovecot-lmtp#" \ -# /etc/postfix/main.cf || _failed=true -# perl -i-n -p -e "s#^(\s*)(dovecot_destination_recipient_limit.*)#\1\#\2#" /etc/postfix/main.cf || _failed=true -# if ! $_failed ; then -# echo -e "$rc_done" -# else -# echo -e "$rc_failed" -# fatal "Adjusting /etc/postfix/main.cf failed" -# fi -# -#fi +# - /etc/postfix/main.cf +# - +# - comment in: +# - #virtual_transport = dovecot +# - #dovecot_destination_recipient_limit = .. +# - +# - change: +# - smtpd_sasl_auth_enable = yes +# - smtpd_sasl_type = dovecot +# - smtpd_sasl_path = private/dovecot-auth +# - virtual_transport = lmtp:unix:private/dovecot-lmtp +var="smtpd_sasl_auth_enable" +val="yes" +echononl "\t${postfix_main_cf}: adjust '${val}'.." +if ! $(grep -E -q "^\s*${var}\s*=\s*${val}" ${postfix_main_cf} 2> /dev/null) ; then + perl -i -n -p -e "s#^(\s*)(smtpd_sasl_type\ *=.*)#smtpd_sasl_type = dovecot#" \ + /etc/postfix/main.cf > $log_file 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + changed=true + else + echo_failed + error "$(cat "$log_file")" + fi +else + echo_skipped +fi + +var="smtpd_sasl_type" +val="dovecot" +echononl "\t${postfix_main_cf}: adjust '${val}'.." +if ! $(grep -E -q "^\s*${var}\s*=\s*${val}" ${postfix_main_cf} 2> /dev/null) ; then + perl -i -n -p -e "s#^(\s*)(smtpd_sasl_type\ *=.*)#smtpd_sasl_type = dovecot#" \ + /etc/postfix/main.cf > $log_file 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + changed=true + else + echo_failed + error "$(cat "$log_file")" + fi +else + echo_skipped +fi + +var="smtpd_sasl_path" +val="private/dovecot-auth" +echononl "\t${postfix_main_cf}: adjust '${val}'.." +if ! $(grep -E -q "^\s*${var}\s*=\s*${val}" ${postfix_main_cf} 2> /dev/null) ; then + perl -i -n -p -e "s#^(\s*)(smtpd_sasl_type\ *=.*)#smtpd_sasl_type = dovecot#" \ + /etc/postfix/main.cf > $log_file 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + changed=true + else + echo_failed + error "$(cat "$log_file")" + fi +else + echo_skipped +fi + +var="virtual_transport" +val="lmtp:unix:private/dovecot-lmtp" +echononl "\t${postfix_main_cf}: adjust '${val}'.." +if ! $(grep -E -q "^\s*${var}\s*=\s*${val}" ${postfix_main_cf} 2> /dev/null) ; then + perl -i -n -p -e "s#^(\s*)(smtpd_sasl_type\ *=.*)#smtpd_sasl_type = dovecot#" \ + /etc/postfix/main.cf > $log_file 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + changed=true + error "$(cat "$log_file")" + fi +else + echo_skipped +fi + + +echononl "\tComment variable 'dovecot_destination_recipient_limit'.." +if $(grep -E -q "^\s*dovecot_destination_recipient_limit" ${postfix_main_cf} 2> /dev/null) ; then + perl -i-n -p -e "s/^(\s*)(dovecot_destination_recipient_limit.*)/\1\#\2/" /etc/postfix/main.cf > $log_file 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + changed=true + else + echo_failed + error "$(cat "$log_file")" + fi +else + echo_skipped +fi + ## -----------------