Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SendMailService does not send mails, mail validation is called wrong #1112

Open
rengaw83 opened this issue Aug 28, 2024 · 1 comment
Open

Comments

@rengaw83
Copy link

rengaw83 commented Aug 28, 2024

Before an mail is send, the address is validated:

if (GeneralUtility::validEmail($email['receiverEmail'] === false) ||
GeneralUtility::validEmail($email['senderEmail']) === false) {
return false;
}

The validation of the receiverEmail is always wrong: GeneralUtility::validEmail($email['receiverEmail'] === false). GeneralUtility::validEmail is always called with a bool value, not the mail address.
The bracket is incorrectly placed.

The bug exists since version 11/12 and was integrated in
11b7b14#diff-2d5d4d02fe84a8e6e4354363868cb6218f61c804b9d3e6ac6423cb75874028fdR97-R98

@rengaw83
Copy link
Author

rengaw83 commented Aug 28, 2024

With the Following fix the mail send works like expected again:

- if (GeneralUtility::validEmail($email['receiverEmail'] === false) || 
+ if (GeneralUtility::validEmail($email['receiverEmail']) === false || 
     GeneralUtility::validEmail($email['senderEmail']) === false) { 
     return false; 
 }
 if (empty($email['subject'])) {
      // don't want an error flashmessage
      return true;
 }
 return $this->prepareAndSend($email);

I have created an PR for that: #1113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant