diff --git a/roles/mail_server/molecule/default/tests/test_mandatory.py b/roles/mail_server/molecule/default/tests/test_mandatory.py index 6feec89f0aa58111c94f6565cd7e699f3f4f1335..f1997002a7036bd1f93a41df09db4a5b3bf59468 100644 --- a/roles/mail_server/molecule/default/tests/test_mandatory.py +++ b/roles/mail_server/molecule/default/tests/test_mandatory.py @@ -268,3 +268,17 @@ def test_sieve_tls_configuration(host): # @TODO: Currently not possible to test since openssl s_client does not # support STARTTLS for Sieve. pass + + +def test_mail_message_size_limit(host): + """ + Tests if the mail message size limit advertised by the SMTP server + is correct. + """ + + capabilities = host.run("(echo 'ehlo localhost' && sleep 2) | telnet localhost 25") + begin = capabilities.stdout.find("250-SIZE") + end = capabilities.stdout.find("\n", begin) + mail_message_size_limit = capabilities.stdout[begin:end] + + assert mail_message_size_limit == "250-SIZE 10240000"