diff --git a/roles/mail_forwarder/molecule/default/tests/test_optional.py b/roles/mail_forwarder/molecule/default/tests/test_optional.py index d0375369d89ca382de7f772b4fd57381708d061b..ea1441c69781911a5a1cfa627dd1aba3629d4f20 100644 --- a/roles/mail_forwarder/molecule/default/tests/test_optional.py +++ b/roles/mail_forwarder/molecule/default/tests/test_optional.py @@ -126,3 +126,17 @@ def test_tls_enforced_towards_relay_mail_server(host): pattern = r"%s: to=, relay=domain1.*status=deferred \(Server certificate not verified\)" % message_id assert re.search(pattern, mail_log.content_string) is not None + + +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 20480001"