@@ -68,3 +68,17 @@ def test_direct_mail_sending(host):
pattern = r"%s: to=<root@domain1>, relay=domain1\[[^]]*\]:25.*status=sent" % 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 10240000"