#107171HTTP 503 on sending EXT:form with EmailToSender finisher using non-fully-qualified address like my.name@domain
Description
- If you have a form made with EXT:form which contains an email field it adds a <input type="email"> html element which does validation.
- If you add a EmailToSender finisher additionally validation is done on the server side by GeneralUtility::validEmail($address); in the finisher.
But if you enter an email address like my.namedomain@ and send the form you will get a HTTP 503 response:
Expected response code "250/251/252" but got code "504", with message "504 5.5.2 <my.name@domain>: Recipient address rejected: need fully-qualified address".
This is obviously because in general such an email address is valid, but symfony/mailer/Transport/Smtp/SmtpTransport.php denies to send it.
User experience in such a case is bad as the user gets a 503 full page error instead of a validation error beforehand.
I realize there is the DNSCheckValidation available as an additional validators option since 66179: [FEATURE] Improved Email Validation but it is not enabled by default.
- Should DNSCheckValidation be enabled by default on new instances to avoid this?
- Should the EmailToSender finisher of EXT:form be extended to do this validation beforehand?
- At least the EmailToSender finisher should catch any exception thrown by GeneralUtility::makeInstance(MailerInterface::class)->send($mail); and throw a FinisherException instead in order to allow a better experience for the user