emails: check SMTP server response against bytes (#37971)

This commit is contained in:
Frédéric Péters 2019-11-26 16:09:17 +01:00
parent 2e31a5731f
commit 73088ea36e
1 changed files with 1 additions and 1 deletions

View File

@ -333,7 +333,7 @@ def create_smtp_server(emails_cfg, smtp_timeout=None):
if rc_code != 250:
get_logger().error('Failed to EHLO to SMTP server (%s)', rc_code)
raise errors.EmailError('Failed to EHLO to SMTP server (%s)' % rc_code)
if 'STARTTLS' in ehlo_answer:
if b'STARTTLS' in ehlo_answer:
rc_code, starttls_answer = s.starttls()
if rc_code != 220:
get_logger().error('Failed to STARTTLS to SMTP server (%s)', rc_code)