1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-09-16 09:06:32 +02:00

Unique exit codes

This commit is contained in:
Florent Daigniere
2023-04-08 13:23:28 +02:00
parent c008ce6608
commit a61de6c2e3

View File

@@ -77,6 +77,7 @@ def test_SMTP(server, username, password):
conn.ehlo() conn.ehlo()
conn.login(username, password) conn.login(username, password)
print(f'Authenticating to smtp://{username}:{password}@{server}:587/ worked!') print(f'Authenticating to smtp://{username}:{password}@{server}:587/ worked!')
os.exit(104)
except smtplib.SMTPNotSupportedError: except smtplib.SMTPNotSupportedError:
print('NOK - expected') print('NOK - expected')
#port 25 should fail #port 25 should fail
@@ -88,6 +89,7 @@ def test_SMTP(server, username, password):
conn.ehlo() conn.ehlo()
conn.login(username, password) conn.login(username, password)
print(f'Authenticating to smtps://{username}:{password}@{server}:25/ worked!') print(f'Authenticating to smtps://{username}:{password}@{server}:25/ worked!')
os.exit(105)
except smtplib.SMTPNotSupportedError: except smtplib.SMTPNotSupportedError:
print('NOK - expected') print('NOK - expected')
try: try:
@@ -96,7 +98,7 @@ def test_SMTP(server, username, password):
conn.ehlo() conn.ehlo()
conn.login(username, password) conn.login(username, password)
print(f'Authenticating to smtp://{username}:{password}@{server}:25/ worked without STARTTLS!') print(f'Authenticating to smtp://{username}:{password}@{server}:25/ worked without STARTTLS!')
os.exit(104) os.exit(106)
except smtplib.SMTPNotSupportedError: except smtplib.SMTPNotSupportedError:
print('NOK - expected') print('NOK - expected')