Issue Bug Closed

#100084Only send test email if sender is configured

Sybille Peters 03/04/23, 12:57 updated 07/09/24, 12:46

Description

If the sender email is not configured via $GLOBALS[‘TYPO3_CONF_VARS’][‘MAIL’][‘defaultMailFromAddress’], a default is used (no-reply@example.com).

The problem with this behaviour is:

- Not setting the value 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 adress like ‘no-reply@example.com’ 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.

I think it would be better to display an error message, if the defaultMailFromAddress is not configured.

Also the email was not checked with GeneralUtility::validEmail().

Reproduce

1. SEt $GLOBALS[‘TYPO3_CONF_VARS’][‘MAIL’][‘defaultMailFromAddress’] to empty
2. Send a test email via “Enviroment” => “Test Mail Setup”. A sender Adress “no-reply @ example.com” is used

Reviews 4