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

Resolve email configuration issues #2401

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Konstantinos-Papanagnou

This branch will fix some issues with the email configuration + will add some verbose output when something fails with the configuration.

Will display error messages when something is wrong with the configuration
Probably the SMTP_SSL function is broken and keeps providing SSL errors. If we start a TLS session via SMTP it works fine.
@ColdHeat
Copy link
Member

Hi you don't need to comment out the code, you can just remove it. We will see the changes in git history.

However can you cite to me how you are determining the correct means of "configuring TLS communications for SMTP"?

@Konstantinos-Papanagnou
Copy link
Author

Hello,

Ah right, forgot to remove the code from my tests. I'll issue another commit removing those on this branch.

Basically what the issue is here is that when using the SMTP_SSL function the operation fails with an os.SSL error every time, as incorrect SSL cipher. The fix I found was to use the plain SMTP function while retaining the starttls command later.

I was using Microsoft's O365 smtp endpoint on port 587 which actually requires TLS and StartTLS enabled.

The patch I've issued here fixes it (which was trial and error)

@Konstantinos-Papanagnou
Copy link
Author

Konstantinos-Papanagnou commented Sep 22, 2023

Had another look today, Microsoft says SSL and TLS are required while configuring but it's actually not based on this:
https://stackoverflow.com/questions/69541840/ssl-error-while-sending-email-using-smtp-with-python

So if we disable SSL it works like before. No need to amend any changes in the smtp.py file as it may break ctfd for other people. I reverted that change. However, feel free to amend the verbose update on what's wrong to auth.py file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants