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

feat: Reworking the SMTP uri to use smtps scheme for implicit TLS and smtp for explicit StartTLS/cleartext #1770

Closed
wants to merge 5 commits into from

Conversation

StarAurryon
Copy link

@StarAurryon StarAurryon commented Sep 21, 2021

This changes the previous behaviour of the smtp uri from:
smtps://server:xxx/?skip_ssl_verify=true&legacy_ssl=true

To:
smtp://server:xxx/?skip_starttls=true&skip_ssl_verify=true (for StartTLS/cleartext)
smtps://server:xxx/?skip_ssl_verify=true (for Implicit TLS)

Related issue(s)

Closes #1769

Checklist

Further Comments

I'm just having issues with MySQL persistence tests that seem unrelated. Could you confirm?

@CLAassistant
Copy link

CLAassistant commented Sep 21, 2021

CLA assistant check
All committers have signed the CLA.

@StarAurryon StarAurryon changed the title Reworking the SMTP uri to use smtps scheme for implicit TLS and smtp … BREAKING CHANGE: Reworking the SMTP uri to use smtps scheme for implicit TLS and smtp for explicit StartTLS/cleartext Sep 21, 2021
@StarAurryon StarAurryon changed the title BREAKING CHANGE: Reworking the SMTP uri to use smtps scheme for implicit TLS and smtp for explicit StartTLS/cleartext feat: Reworking the SMTP uri to use smtps scheme for implicit TLS and smtp for explicit StartTLS/cleartext Sep 21, 2021
@StarAurryon StarAurryon force-pushed the smtp-scheme-rework branch 3 times, most recently from 9d06f24 to aac7d9a Compare September 21, 2021 21:52
@codecov
Copy link

codecov bot commented Sep 21, 2021

Codecov Report

Merging #1770 (a957605) into master (c6aa6b5) will decrease coverage by 0.04%.
The diff coverage is 90.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1770      +/-   ##
==========================================
- Coverage   74.07%   74.03%   -0.05%     
==========================================
  Files         260      260              
  Lines       12770    12773       +3     
==========================================
- Hits         9460     9456       -4     
- Misses       2680     2684       +4     
- Partials      630      633       +3     
Impacted Files Coverage Δ
selfservice/strategy/oidc/provider_microsoft.go 0.00% <ø> (ø)
x/mailhog.go 6.97% <0.00%> (ø)
courier/courier.go 59.15% <100.00%> (-9.20%) ⬇️
cmd/courier/watch.go 72.41% <0.00%> (+12.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 164a90d...a957605. Read the comment docs.

Copy link
Member

@zepatrik zepatrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not look too deep into the actual code change, this is only regarding documentation.

docs/docs/reference/configuration.md Outdated Show resolved Hide resolved
driver/config/.schema/config.schema.json Outdated Show resolved Hide resolved
@StarAurryon
Copy link
Author

I just rebased against the latest master.

@aeneasr
Copy link
Member

aeneasr commented Sep 29, 2021

Could you please add a breaking change note in form of a comment here that helps users upgrade their existing SMTP URLs to the new format? Thank you!

Example:

BREAKING CHANGE: This changes x to y please do z.

Examples:

- x -> y
- z -> x

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This is looking good! Could you please also add documentation to this page: https://www.ory.sh/kratos/docs/concepts/email-sms/#sending-e-mails-via-smtp

courier/courier.go Outdated Show resolved Hide resolved
@StarAurryon
Copy link
Author

Could you please add a breaking change note in form of a comment here that helps users upgrade their existing SMTP URLs to the new format? Thank you!

Example:

BREAKING CHANGE: This changes x to y please do z.

Examples:

- x -> y
- z -> x

Would you like me to do it only on the first commit? And should I merge the 3 into one?

@aeneasr
Copy link
Member

aeneasr commented Sep 30, 2021

You can add it as a comment! I will squash merge them anyways :)

StarAurryon and others added 5 commits October 5, 2021 16:17
… smtp for explicit StartTLS/cleartext

BREAKING CHANGE: The smtps scheme used in courier config url with cleartext/StartTLS/TLS SMTP connection types is now only supporting implicit TLS.
For StartTLS and cleartext SMTP, please use the smtp scheme instead.

Example:
- SMTP Cleartext:
  smtp://foo:bar@my-mailserver:1234/?disable_starttls=true
- SMTP with StartTLS:
  smtps://foo:bar@my-mailserver:1234/ -> smtp://foo:bar@my-mailserver:1234/
- SMTP with implicit TLS:
  smtps://foo:bar@my-mailserver:1234/?legacy_ssl=true -> smtps://foo:bar@my-mailserver:1234/
Fixing drivers/config/.schema/config.schema.json

Co-authored-by: Patrik <zepatrik@users.noreply.github.com>
@StarAurryon StarAurryon force-pushed the smtp-scheme-rework branch 2 times, most recently from 4762890 to a957605 Compare October 5, 2021 14:39
@StarAurryon
Copy link
Author

Wow! The error in circleci is weird. Any idea?

@aeneasr
Copy link
Member

aeneasr commented Oct 6, 2021

looks like a flake - restarting the job :)

@aeneasr
Copy link
Member

aeneasr commented Oct 12, 2021

It passed! :) I will resolve the merge conflict and it's good to go!

aeneasr added a commit that referenced this pull request Oct 12, 2021
…artTLS, and cleartext SMTP (#1831)

BREAKING CHANGE: The SMTPS scheme used in courier config url with cleartext/StartTLS/TLS SMTP connection types is now only supporting implicit TLS. For StartTLS and cleartext SMTP, please use the smtp scheme instead.

Example:
- SMTP Cleartext: `smtp://foo:bar@my-mailserver:1234/?disable_starttls=true`
- SMTP with StartTLS: `smtps://foo:bar@my-mailserver:1234/` -> `smtp://foo:bar@my-mailserver:1234/`
- SMTP with implicit TLS: `smtps://foo:bar@my-mailserver:1234/?legacy_ssl=true` -> `smtps://foo:bar@my-mailserver:1234/`

Closes #1770
Closes #1769
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.

Reworking the SMTP uri as the scheme is confusing
4 participants