From f5dac6e71cec7dfa87e31400b4f91c5cd12d290f Mon Sep 17 00:00:00 2001 From: Erik Wramner Date: Sun, 11 Aug 2019 17:14:00 +0200 Subject: [PATCH] Disable SMTPUTF8 as Dovecot can't handle it --- target/start-mailserver.sh | 6 ++++++ test/test-files/email-templates/smtp-ehlo.txt | 2 ++ test/tests.bats | 8 ++++++++ 3 files changed, 16 insertions(+) create mode 100644 test/test-files/email-templates/smtp-ehlo.txt diff --git a/target/start-mailserver.sh b/target/start-mailserver.sh index 2dd25a02..d085a4b1 100644 --- a/target/start-mailserver.sh +++ b/target/start-mailserver.sh @@ -122,6 +122,7 @@ function register_functions() { _register_setup_function "_setup_postfix_hostname" _register_setup_function "_setup_dovecot_hostname" + _register_setup_function "_setup_postfix_smtputf8" _register_setup_function "_setup_postfix_sasl" _register_setup_function "_setup_postfix_override_configuration" _register_setup_function "_setup_postfix_sasl_password" @@ -706,6 +707,11 @@ function _setup_postfix_sizelimits() { postconf -e "mailbox_size_limit = ${DEFAULT_VARS["POSTFIX_MAILBOX_SIZE_LIMIT"]}" } +function _setup_postfix_smtputf8() { + notify 'inf' "Configuring postfix smtputf8 support (disable)" + postconf -e "smtputf8_enable = no" +} + function _setup_spoof_protection () { notify 'inf' "Configuring Spoof Protection" sed -i 's|smtpd_sender_restrictions =|smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch,|' /etc/postfix/main.cf diff --git a/test/test-files/email-templates/smtp-ehlo.txt b/test/test-files/email-templates/smtp-ehlo.txt new file mode 100644 index 00000000..05524efd --- /dev/null +++ b/test/test-files/email-templates/smtp-ehlo.txt @@ -0,0 +1,2 @@ +EHLO mail.localhost +QUIT diff --git a/test/tests.bats b/test/tests.bats index e65e6693..1c29f86e 100644 --- a/test/tests.bats +++ b/test/tests.bats @@ -405,6 +405,14 @@ function count_processed_changes() { [ "$status" -ge 0 ] } +@test "checking smtp: not advertising smtputf8" { + # Dovecot does not support SMTPUTF8, so while we can send we cannot receive + # Better disable SMTPUTF8 support entirely if we can't handle it correctly + run docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/smtp-ehlo.txt | grep SMTPUTF8 | wc -l" + assert_success + assert_output 0 +} + # # accounts #