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

TLS issue / STARTTLS support #250

Closed
busslina opened this issue Jun 15, 2024 · 2 comments · Fixed by #251
Closed

TLS issue / STARTTLS support #250

busslina opened this issue Jun 15, 2024 · 2 comments · Fixed by #251

Comments

@busslina
Copy link

busslina commented Jun 15, 2024

I commented this issue here.

Thanks

Update I:

I think the issue can be related to STARTTLS. If I'm correct, this protocol starts in plain text and then it upgrades to TLS after negotiating it. So this library attempts to stablish a TLS connection when ssl is true. So seems that is not possible to connect to a Postfix server (at least I didn't found how to disable STARTTLS).

Update II:

I thought that Dart didn't support STARTTLS but it seems it can be done this way:
https://stackoverflow.com/a/17643296/4681977
https://api.dart.dev/main/627cd3047d2b52e23ba0cd3e31782c0f5ac97e85/dart-io/SecureSocket/secure.html

@busslina busslina changed the title TLS issue TLS issue / STARTTLS support Jun 15, 2024
@close2
Copy link
Collaborator

close2 commented Jun 17, 2024

I've added some more information in dart-lang/sdk#52886

But the TL;DR is: Don't use ssl. mailer will automatically upgrade the connection to an encrypted connection using the smtp command starttls. If the server does not support tls mailer will either continue over an insecure connection if the option allowInsecure is given (off by default) or fail otherwise.

There are very few ssl smtp servers. Usually smtp connections are started over insecure connections and then upgraded to secure ones, using the starttls command.

@busslina
Copy link
Author

busslina commented Jun 17, 2024

Cool, thanks. This issue pushed me into studying how SMTP works.

There are very few ssl smtp servers.

My server is one of them and it works great with ssl to true.

So now I fully understand how this package works. Maybe would be a good idea to specify this info on the SmtpServer class documentation.

And thank you again :)

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 a pull request may close this issue.

2 participants