Skip to content

Commit 9c7ba05

Browse files
committed
Removes unused TLS/SSL placeholders from sendmail suite and mappings for now
1 parent b9c4919 commit 9c7ba05

3 files changed

Lines changed: 1 addition & 58 deletions

File tree

ports-py/sendmail-python-emails.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -104,33 +104,6 @@ def sendmail_connect(env, host, port):
104104
def sendmail_connect_with_credentials(env, host, port, username, password):
105105
backend = SMTPBackend(host=host, port=port, user=username, password=password)
106106
return backend
107-
108-
@sendmail_suite.placeholder("sendmail-connect-with-auto-starttls")
109-
def sendmail_connect_with_auto_starttls(env, host, port, automatic_mode):
110-
pass
111-
112-
@sendmail_suite.placeholder("sendmail-secure-connect")
113-
def sendmail_secure_connect(env, host, port, cafile):
114-
pass
115-
116-
@sendmail_suite.placeholder("sendmail-secure-connect-with-timeout")
117-
def sendmail_secure_connect_with_timeout(env, host, port, cafile, timeout=None):
118-
pass
119-
# context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
120-
# context.check_hostname = False
121-
# context.verify_mode = ssl.CERT_NONE
122-
# context.load_verify_locations(ports.fixture_path(cafile))
123-
# if timeout:
124-
# try:
125-
# result = smtplib.SMTP_SSL(host, port, context=context, timeout=float(timeout))
126-
# except TimeoutError as err:
127-
# return err
128-
# else:
129-
# result = smtplib.SMTP_SSL(host, port, context=context)
130-
# if isinstance(result, ssl.SSLError):
131-
# raise result
132-
# else:
133-
# return result
134107

135108
@sendmail_suite.placeholder("sendmail-disconnect")
136109
def sendmail_disconnect(env, sender):
@@ -175,7 +148,7 @@ def sendmail_error(env, result: SMTPResponse):
175148
# Running
176149
#
177150

178-
# they do mitigation for addresses but detection for other fields
151+
# python-emails does mitigation for addresses but detection for other fields
179152

180153
sendmail_suite.run(
181154
exclude_capabilities=(

ports-py/sendmail-redmail.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -111,33 +111,6 @@ def sendmail_connect_with_credentials(env, host, port, username, password):
111111
except Exception as e:
112112
sender.close()
113113
return e
114-
115-
@sendmail_suite.placeholder("sendmail-connect-with-auto-starttls")
116-
def sendmail_connect_with_auto_starttls(env, host, port, automatic_mode):
117-
pass
118-
119-
@sendmail_suite.placeholder("sendmail-secure-connect")
120-
def sendmail_secure_connect(env, host, port, cafile):
121-
pass
122-
123-
@sendmail_suite.placeholder("sendmail-secure-connect-with-timeout")
124-
def sendmail_secure_connect_with_timeout(env, host, port, cafile, timeout=None):
125-
pass
126-
# context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
127-
# context.check_hostname = False
128-
# context.verify_mode = ssl.CERT_NONE
129-
# context.load_verify_locations(ports.fixture_path(cafile))
130-
# if timeout:
131-
# try:
132-
# result = smtplib.SMTP_SSL(host, port, context=context, timeout=float(timeout))
133-
# except TimeoutError as err:
134-
# return err
135-
# else:
136-
# result = smtplib.SMTP_SSL(host, port, context=context)
137-
# if isinstance(result, ssl.SSLError):
138-
# raise result
139-
# else:
140-
# return result
141114

142115
@sendmail_suite.placeholder("sendmail-disconnect")
143116
def sendmail_disconnect(env, sender):

suites/sendmail.ports

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
; SMTP connection
2121
(placeholder '(sendmail-connect host port) "Should connect and return some representation of the connection.")
2222
(placeholder '(sendmail-connect-with-credentials host port user password) "Should connect and return some representation of the connection. The credentials should be used to authenticate the connection.")
23-
(placeholder '(sendmail-connect-with-auto-starttls host port starttls-mode) "Should connect and set the automatic starttls mode (which can be 'automatic (send starttls if available, otherwise do not), 'required (connect and send starttls, fail if server does not support it), 'never (do not automatically send starttls)). In case the connection results in an error (e.g. starttls mode is 'required but server does not support starttls), the error should be returned.")
24-
(placeholder '(sendmail-secure-connect host port ca-file) "Should connect to an SMTP server via a secure connection (SSL/TLS) and return some representation of the connection.")
25-
(placeholder '(sendmail-secure-connect-with-timeout host port ca-file timeout) "Same as sendmail-secure-connect but the connection should be aborted if the handshake does not complete within the timeout.")
2623
(placeholder '(sendmail-disconnect connection) "Should close the connection")
2724
(placeholder '(sendmail-connected? connection) "Should return true if the connection is still open")
2825

0 commit comments

Comments
 (0)