Skip to content

Conversation

amureki
Copy link
Collaborator

@amureki amureki commented Nov 8, 2021

Dot is unreserved character, however the representation in browsers (%2E or .), mail clients and even SMTP-servers is not unified and can lead to different issues:

Also, Django is using dot for some funky JSON compression in django.core.signing:
https://github.com/django/django/blob/4f8c7fd9d91b35e2c2922de4bb50c8c8066cbbc6/django/core/signing.py#L29-L30

So, in this PR I am suggesting to drop custom separator and switch to the default colon (:).
It is also not reserved of anything in domain path, but only in host and scheme parts.

Dot is unreserved character, however the representation in browsers (`%2E` or `.`), mail clients and even SMTP-servers is not unified and can lead to different issues:
- https://wordtothewise.com/2018/11/why-do-my-urls-have-two-dots/
- https://bugs.python.org/issue43922

Also, Django is using dot for some funky JSON compression in `django.core.signing`:
https://github.com/django/django/blob/4f8c7fd9d91b35e2c2922de4bb50c8c8066cbbc6/django/core/signing.py#L29-L30

So, in this PR I am suggesting to drop custom separator and switch to the default colon (`:`).
It is also not reserved of anything in domain path, but only in host and scheme parts.
- https://www.rfc-editor.org/rfc/rfc3986#section-3.3
- https://security.stackexchange.com/questions/159099/colons-in-urls-safe
Copy link
Owner

@codingjoe codingjoe left a comment

Choose a reason for hiding this comment

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

Thank @amureki, that was more RFC standards than I ever wanted to read in my life. But I learned a ton and this might help others to avoid those funny email problems in the future.

@amureki amureki self-assigned this Nov 8, 2021
@codecov
Copy link

codecov bot commented Nov 10, 2021

Codecov Report

Merging #28 (d56f6e3) into master (cb4c205) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #28   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          333       331    -2     
=========================================
- Hits           333       331    -2     
Impacted Files Coverage Δ
mailauth/signing.py 100.00% <ø> (ø)

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 cb4c205...d56f6e3. Read the comment docs.

Django versions <3 have no compatibility with psycopg-binary>=2.9.
django/django#14530

I'd be up for dropping Django 2.2 completely, as it is now only receiving security support, but we also can wait until April and simply pin psycopg-binary in CI until then (as I would not expect anything breaking because of that).
@amureki amureki requested a review from codingjoe November 10, 2021 16:26
Copy link
Owner

@codingjoe codingjoe left a comment

Choose a reason for hiding this comment

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

LGTM, this will be a breaking change, so you will need to create a major release.

@amureki amureki merged commit 0caaa5a into codingjoe:master Nov 14, 2021
@amureki amureki deleted the drop_custom_separator branch November 15, 2021 08:19
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.

2 participants