Ghost/ghost/core/test/regression/api/admin
Simon Backx 17ec1e8937
Added email address alignment protections (#19094)
ref GRO-54
fixes GRO-63
fixes GRO-62
fixes GRO-69

When the config `hostSettings:managedEmail:enabled` is enabled, or the
new flag (`newEmailAddresses`) is enabled for self-hosters, we'll start
to check the from addresses of all outgoing emails more strictly.

- Current flow: nothing changes if the managedEmail config is not set or
the `newEmailAddresses` feature flag is not set
- When managedEmail is enabled: never allow to send an email from any
chosen email. We always use `mail.from` for all outgoing emails. Custom
addresses should be set as replyTo instead. Changing the newsletter
sender_email is not allowed anymore (and ignored if it is set).
- When managedEmail is enabled with a custom sending domain: if a from
address doesn't match the sending domain, we'll default to mail.from and
use the original as a replyTo if appropriate and only when no other
replyTo was set. A newsletter sender email addresss can only be set to
an email address on this domain.
- When `newEmailAddresses` is enabled: self hosters are free to set all
email addresses to whatever they want, without verification. In addition
to that, we stop making up our own email addresses and send from
`mail.from` by default instead of generating a `noreply`+ `@` +
`sitedomain.com` address

A more in depth example of all cases can be seen in
`ghost/core/test/integration/services/email-addresses.test.js`

Includes lots of new E2E tests for most new situations. Apart from that,
all email snapshots are changed because the from and replyTo addresses
are now included in snapshots (so we can see unexpected changes in the
future).

Dropped test coverage requirement, because tests were failing coverage
locally, but not in CI

Fixed settings test that set the site title to an array - bug tracked in
GRO-68
2023-11-23 10:25:30 +01:00
..
__snapshots__ Added email address alignment protections (#19094) 2023-11-23 10:25:30 +01:00
authentication.test.js Added Source as the new default theme 2023-10-03 14:02:08 +02:00
db.test.js 🔒 Fixed arbitrary file read via symlinks in content import 2023-08-15 13:01:11 +02:00
identities.test.js Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
images.test.js Removed all unused variables from test files 2023-03-10 14:29:55 +01:00
members-importer.test.js Added email address alignment protections (#19094) 2023-11-23 10:25:30 +01:00
members-signin-url.test.js Added member attribution events and storage (#15243) 2022-08-18 17:38:42 +02:00
notifications.test.js Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
pages.test.js Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
posts.test.js Removed old email flow (#16349) 2023-03-07 16:08:40 +01:00
redirects.test.js Removed all unused variables from test files 2023-03-10 14:29:55 +01:00
schedules.test.js Replaced Bluebird Promise.mapSeries with sequence util (#17008) 2023-06-23 09:04:37 +02:00
settings.test.js Removed all unused variables from test files 2023-03-10 14:29:55 +01:00
slack.test.js Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
update-user-last-seen.test.js Removed all unused variables from test files 2023-03-10 14:29:55 +01:00
users.test.js Fixed import of bson-objectid in accordance to the typings 2022-10-12 14:54:35 +07:00
utils.js Cleaned up lexicalEditor labs flag, switched Post model to lexical-by-default (#18607) 2023-10-23 17:51:34 +01:00
webhooks.test.js Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00