Feature: #92531 - Improved Email Validation

See forge#92531

Description

The method \TYPO3\CMS\Core\Utility\GeneralUtility::validEmail() is used to validate a given email address through the core and TYPO3 extensions.

The validation can now be configured by providing the used validators in the LocalConfiguration.php or AdditionalConfiguration.php:

$GLOBALS['TYPO3_CONF_VARS']['MAIL']['validators'] = [
  \Egulias\EmailValidator\Validation\RFCValidation::class,
  \Egulias\EmailValidator\Validation\DNSCheckValidation::class
];
Copied!

By default, the validator \Egulias\EmailValidator\Validation\RFCValidation is used. The following validators are available by default:

  • \Egulias\EmailValidator\Validation\DNSCheckValidation
  • \Egulias\EmailValidator\Validation\SpoofCheckValidation
  • \Egulias\EmailValidator\Validation\NoRFCWarningsValidation

Additionally it is possible to provide an own implementation by implementing the interface \Egulias\EmailValidator\Validation\EmailValidation.

If multiple validators are provided, each validator must return TRUE.

Impact

Using additional validators can help to identify if a provided email address is valid or not.