Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext_smtp.py TLS without SSL #667

Closed
TomFreudenberg opened this issue Jan 17, 2024 · 2 comments
Closed

ext_smtp.py TLS without SSL #667

TomFreudenberg opened this issue Jan 17, 2024 · 2 comments

Comments

@TomFreudenberg
Copy link
Contributor

The activation for TLS is only possible on SSL connection.

That is not necessary nor that all services have enabled SSL.

if is_true(params['tls']):
LOG.debug("%s : initiating tls" % self._meta.label)
server.starttls()

The TLS starttls command should be possible for non-SSL connections as well to make sure that the message channel is encrypted.

Would you like me to send in a PR for that?

Best regards
Tom

@TomFreudenberg
Copy link
Contributor Author

The code

if is_true(params['ssl']):
server = smtplib.SMTP_SSL(params['host'], params['port'],
params['timeout'])
LOG.debug("%s : initiating ssl" % self._meta.label)
if is_true(params['tls']):
LOG.debug("%s : initiating tls" % self._meta.label)
server.starttls()
else:
server = smtplib.SMTP(params['host'], params['port'],
params['timeout'])

should be:

        if is_true(params['ssl']):
            server = smtplib.SMTP_SSL(params['host'], params['port'],
                                      params['timeout'])
            LOG.debug("%s : initiating ssl" % self._meta.label)

        else:
            server = smtplib.SMTP(params['host'], params['port'],
                                  params['timeout'])

        if is_true(params['tls']):
            LOG.debug("%s : initiating tls" % self._meta.label)
            server.starttls()

@derks derks added this to the 3.0.10 Stable milestone Jan 18, 2024
@derks derks self-assigned this Jan 18, 2024
@derks
Copy link
Member

derks commented Feb 29, 2024

Resolved in main, will be released with stable/3.0.10.

@derks derks closed this as completed Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants