Skip to content

Conversation

@EvanHahn
Copy link
Contributor

@EvanHahn EvanHahn commented Jan 20, 2026

ref a5384b4
ref TryGhost/Ghost#25920

@tryghost/parse-email-address will be moved to the main Ghost repo in TryGhost/Ghost#25920.

This reverts commit a5384b4.

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

EvanHahn added a commit to TryGhost/Ghost that referenced this pull request Jan 21, 2026
closes https://linear.app/ghost/issue/NY-942/create-and-use-parse-email-address-package-in-core
ref #25919
ref TryGhost/framework#342

This creates the `parse-email-address` package (previously reviewed
[here][0]--all I did was move it over) and uses it in email
normalization, used when sending magic links.

This should not change behavior for "normal", lowercase ASCII email
addresses. However, it does make several subtler tweaks to the way
emails are normalized:

- Some totally invalid emails weren't normalized.

  Before: if `req.body.email` wasn't a string or lacked an `@`, no
  normalization would occur. The system would then attempt to send an
  email that'd almost certainly fail.

  After: these throw a "bad request" error.

- Invalid emails with multiple `@` signs were considered valid.

  Before: `foo@bar@example.com` was accepted.

  After: it is not accepted and throws a "bad request" error.

- Long emails are now considered invalid.

  Before: the only limit on email length was that of the request body.

  After: the whole email is limited to 986 octets and the domain is
  limited to 253 octets (per SMTP). Domain labels are limited to 63
  octets (per DNS).

- Domains are now lowercased.

  Before: `FOO@Example.COM` was normalized to `FOO@Example.COM`.

  After: `FOO@Example.COM` is normalized to `FOO@example.com`.

[0]: TryGhost/framework#340
@EvanHahn EvanHahn force-pushed the remove-parse-email-address-package branch from b4505b3 to 2d5bcd9 Compare January 21, 2026 13:42
EvanHahn added a commit to TryGhost/Ghost that referenced this pull request Jan 21, 2026
closes https://linear.app/ghost/issue/NY-942/create-and-use-parse-email-address-package-in-core
ref #25919
ref TryGhost/framework#342

This creates the `parse-email-address` package (previously reviewed
[here][0]--all I did was move it over) and uses it in email
normalization, used when sending magic links.

This should not change behavior for "normal", lowercase ASCII email
addresses. However, it does make several subtler tweaks to the way
emails are normalized:

- Some totally invalid emails weren't normalized.

  Before: if `req.body.email` wasn't a string or lacked an `@`, no
  normalization would occur. The system would then attempt to send an
  email that'd almost certainly fail.

  After: these throw a "bad request" error.

- Invalid emails with multiple `@` signs were considered valid.

  Before: `foo@bar@example.com` was accepted.

  After: it is not accepted and throws a "bad request" error.

- Long emails are now considered invalid.

  Before: the only limit on email length was that of the request body.

  After: the whole email is limited to 986 octets and the domain is
  limited to 253 octets (per SMTP). Domain labels are limited to 63
  octets (per DNS).

- Domains are now lowercased.

  Before: `FOO@Example.COM` was normalized to `FOO@Example.COM`.

  After: `FOO@Example.COM` is normalized to `FOO@example.com`.

[0]: TryGhost/framework#340
EvanHahn added a commit to TryGhost/Ghost that referenced this pull request Jan 21, 2026
closes https://linear.app/ghost/issue/NY-942/create-and-use-parse-email-address-package-in-core
ref #25919
ref TryGhost/framework#342

This creates the `parse-email-address` package (previously reviewed
[here][0]--all I did was move it over) and uses it in email
normalization, used when sending magic links.

This should not change behavior for "normal", lowercase ASCII email
addresses. However, it does make several subtler tweaks to the way
emails are normalized:

- Some totally invalid emails weren't normalized.

  Before: if `req.body.email` wasn't a string or lacked an `@`, no
  normalization would occur. The system would then attempt to send an
  email that'd almost certainly fail.

  After: these throw a "bad request" error.

- Invalid emails with multiple `@` signs were considered valid.

  Before: `foo@bar@example.com` was accepted.

  After: it is not accepted and throws a "bad request" error.

- Long emails are now considered invalid.

  Before: the only limit on email length was that of the request body.

  After: the whole email is limited to 986 octets and the domain is
  limited to 253 octets (per SMTP). Domain labels are limited to 63
  octets (per DNS).

- Domains are now lowercased.

  Before: `FOO@Example.COM` was normalized to `FOO@Example.COM`.

  After: `FOO@Example.COM` is normalized to `FOO@example.com`.

[0]: TryGhost/framework#340
ref a5384b4
ref TryGhost/Ghost#25920

`@tryghost/parse-email-address` has been moved to the main Ghost repo in
<TryGhost/Ghost#25920>.

This reverts commit a5384b4.
@EvanHahn EvanHahn force-pushed the remove-parse-email-address-package branch from 2d5bcd9 to 1e0f31e Compare January 21, 2026 14:29
EvanHahn added a commit to TryGhost/Ghost that referenced this pull request Jan 22, 2026
closes https://linear.app/ghost/issue/NY-942/create-and-use-parse-email-address-package-in-core
ref #25919
ref TryGhost/framework#342

This creates the `parse-email-address` package (previously reviewed
[here][0]--all I did was move it over) and uses it in email
normalization, used when sending magic links.

This should not change behavior for "normal", lowercase ASCII email
addresses. However, it does make several subtler tweaks to the way
emails are normalized:

- Some totally invalid emails weren't normalized.

  Before: if `req.body.email` wasn't a string or lacked an `@`, no
  normalization would occur. The system would then attempt to send an
  email that'd almost certainly fail.

  After: these throw a "bad request" error.

- Invalid emails with multiple `@` signs were considered valid.

  Before: `foo@bar@example.com` was accepted.

  After: it is not accepted and throws a "bad request" error.

- Long emails are now considered invalid.

  Before: the only limit on email length was that of the request body.

  After: the whole email is limited to 986 octets and the domain is
  limited to 253 octets (per SMTP). Domain labels are limited to 63
  octets (per DNS).

- Domains are now lowercased.

  Before: `FOO@Example.COM` was normalized to `FOO@Example.COM`.

  After: `FOO@Example.COM` is normalized to `FOO@example.com`.

[0]: TryGhost/framework#340
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