Review main Merged

78027[BUGFIX] Only send test email if sender address configured

Sybille Peters CR +2 V +2 Normal +66 −19 updated 05/11/23, 17:14

Commit message

It is possible to send a test email in the Environment
section of the Install Tool / Admin Tools.

Previously, if the sender email was not configured via
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress']
a default no-reply email address was used.

Also, the sender email was not checked with GeneralUtility::validEmail.

We now display a message in the dialog if the defaultMailFromAddress
is not configured or is configured with an invalid email address.
In this case, the form with input field and button is also not displayed.

Sending with an invalid sender address is no longer possible
in Test Mail Setup.

The problem with the previous behavior was:

- Not setting the value or setting it incorrectly is incomplete
  configuration. We should make the user aware of this. The point
  of sending a test mail is to test the configuration as well.
- Emails with a sender address which does not exist or is not
  registered for the mail account might get rejected by the
  email server but the user gets no error message, so is kept
  in the dark.
- Notifications from the mail server cannot be sent back if a
  no-reply email is used. If someone configures it that way,
  that is their responsibility, but we should not fall back
  to it.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Stefan Froemken +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Stefan Froemken +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 4360

Show 2635 earlier messages
  1. Sybille Peters uploaded patch set 1 03/04/23, 12:58

  2. Sybille Peters updated the commit message in patch set 2 03/04/23, 13:03

  3. core-ci voted on patch set 1 V +1 03/04/23, 13:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38439

  4. core-ci voted on patch set 2 V +1 03/04/23, 13:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38440

  5. Sybille Peters updated the commit message in patch set 3 V +1 03/04/23, 14:14

  6. core-ci voted on patch set 3 V +1 03/04/23, 14:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38441

  7. Sybille Peters rebased onto patch set 4 V +1 03/05/23, 16:02

  8. core-ci voted on patch set 4 V +1 03/05/23, 17:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38498

  9. Oliver Klee updated the commit message in patch set 5 V +1 03/05/23, 18:38

  10. core-ci voted on patch set 5 V +1 03/05/23, 18:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38501

  11. Kevin Appelt voted on patch set 5 V +1 CR +1 03/09/23, 06:58

  12. Georg Ringer commented on patch set 5 03/09/23, 07:20

    while we are on it. should we show the email address also in the view?
  13. Chris Müller commented on patch set 5 CR -1 03/09/23, 07:32

    EnvironmentController.php:252

    This should be ContextualFeedbackSeverity::ERROR for main. Must then be adjusted when backporting to v11.

    EnvironmentController.php:258

    Here too.
  14. Sybille Peters commented on patch set 5 03/09/23, 07:49

    Reply

    Sounds good. I am on it.
  15. Sybille Peters uploaded patch set 6 CR +1 V +1 03/09/23, 08:31

  16. core-ci voted on patch set 6 V +1 03/09/23, 08:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38679

  17. Sybille Peters commented on patch set 6 03/09/23, 08:38

    Reply

    I think the idea is really good, but I think this can be improved further: The output can depend on the current configuration, so for example you only output the smtp specific hint if smtp is actually configured. But this wouldn't be a bugfix anymore, I think it better to handle in separate patch. Hope is ok with you.

    EnvironmentController.php:252 Reply

    I have changed it. I changed Releases to "main" only. I am not sure if the test would fail in v11 (because of the different error type) and want to avoid this might get merged this way by accident. Also, this already barely a BUGFIX and maybe a FEATURE.

    EnvironmentController.php:258 Reply

    Done
  18. Oliver Klee voted on patch set 6 CR +1 03/09/23, 08:39

  19. Jörg Bösche voted on patch set 6 CR +1 03/10/23, 07:28

  20. Chris Müller voted on patch set 6 CR +1 03/10/23, 07:35

  21. Chris Müller voted on patch set 6 V +1 03/10/23, 07:40

  22. Georg Ringer commented on patch set 6 CR -1 03/10/23, 07:47

    EnvironmentController.php:256

    please provide the provided wrong email address as well, no need to hide that and makes it easier to find the culprit if e.g. using multiple additionalconfigurations, env files, ...
  23. Sybille Peters uploaded patch set 7 CR +1 V +1 03/10/23, 11:24

  24. Sybille Peters commented on patch set 7 03/10/23, 11:25

    EnvironmentController.php:256 Reply

    Done
  25. core-ci voted on patch set 7 V +1 03/10/23, 11:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38765

  26. Oliver Klee voted on patch set 7 CR +1 03/10/23, 11:44

  27. Sybille Peters commented on patch set 7 CR -1 03/10/23, 11:47

    I am checking if can be improved. Warning message should already be displayed when dialog opens.
  28. Sybille Peters uploaded patch set 8 CR +1 V +1 03/10/23, 12:13

  29. Sybille Peters commented on patch set 8 V +1 03/10/23, 12:17

    I tried to send the flash messages on opening the dialog if there is not a valid sender email but that did not work. So the behavior is still the same now. But the current defaultMailFromAddress is now displayed in any case in the Fluid - it was already assigned to the Fluid view before but not used. (the string is properly encoded - in the Fluid - so that should be ok too). Tested behaviour with no email, faulty email and valid email.
  30. Sybille Peters commented on patch set 8 V -1 03/10/23, 12:18

    good grief.
  31. core-ci voted on patch set 8 V -1 03/10/23, 12:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38766

  32. Sybille Peters uploaded patch set 9 V -1 03/10/23, 12:33

  33. Oliver Klee commented on patch set 9 03/10/23, 12:36

    MailTest.html:24

    There should be not period at the end. Also, for better readability, I think a monospace font for the email address would be helpful (then we also could drop the quotes): ``` <f:then>: <code>{mailTestSenderAddress}</code></f:then> ```
  34. core-ci voted on patch set 9 V +1 03/10/23, 12:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38768

  35. Oliver Klee commented on patch set 10 V +1 03/10/23, 14:39

    Published edit on patch set 9.
  1. Oliver Klee commented on patch set 10 03/10/23, 14:40

    MailTest.html:24 Reply

    Done
  2. Oliver Klee voted on patch set 10 CR +1 03/10/23, 14:40

  3. core-ci voted on patch set 10 V +1 03/10/23, 14:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38774

  4. Sybille Peters voted on patch set 10 V +1 03/10/23, 16:56

  5. Chris Müller voted on patch set 10 V +1 CR +1 03/10/23, 20:54

  6. Nikita Hovratov voted on patch set 10 V +1 CR +1 03/10/23, 21:05

  7. Sybille Peters uploaded patch set 11 CR +1 V +1 03/12/23, 09:47

  8. Sybille Peters uploaded patch set 12 03/12/23, 09:49

  9. Sybille Peters uploaded patch set 13 03/12/23, 09:51

  10. Sybille Peters uploaded patch set 14 03/12/23, 09:57

  11. Sybille Peters uploaded patch set 15 03/12/23, 09:57

  12. Sybille Peters commented on patch set 11 V +1 03/12/23, 09:58

    Changed behavior slightly: we now check for valid sender Email as soon as the modal dialog is opened. If no valid sender email given, flash message is displayed and form is not displayed (see commit message). I think it does not make sense, to display the form, if we already know we will not send email. !!! Since JavaScript changed it may be necessary to flush browser cache.
  13. Sybille Peters updated the commit message in patch set 16 03/12/23, 09:59

  14. core-ci voted on patch set 12 V +1 03/12/23, 09:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38819

  15. core-ci voted on patch set 13 V +1 03/12/23, 10:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38820

  16. core-ci voted on patch set 11 V -1 03/12/23, 10:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38818

  17. core-ci voted on patch set 14 V +1 03/12/23, 10:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38821

  18. core-ci voted on patch set 16 V +1 03/12/23, 10:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38823

  19. core-ci voted on patch set 15 V +1 03/12/23, 10:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38822

  20. Benni Mack updated the commit message in patch set 17 V +1 05/03/23, 09:54

  21. Sybille Peters uploaded patch set 18 05/06/23, 10:26

  22. core-ci voted on patch set 18 V +1 05/06/23, 10:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41629

  23. Stefan Froemken voted on patch set 18 V +1 CR +1 05/10/23, 21:05

  24. Stefan Bürk voted on patch set 18 V +2 CR +2 05/11/23, 17:14

  25. Stefan Bürk merged patch set 19 05/11/23, 17:14