continue drafting mail handler

This commit is contained in:
Dennis Eichhorn 2020-12-19 20:31:52 +01:00
parent 91fde08f52
commit b7131f34e1
2 changed files with 8 additions and 15 deletions

View File

@ -1292,8 +1292,8 @@ class Email implements MessageInterface
return ''; return '';
} }
$fileBuffer = file_get_contents($path); $fileBuffer = \file_get_contents($path);
if (false === $fileBuffer) { if ($fileBuffer === false) {
return ''; return '';
} }

View File

@ -322,8 +322,6 @@ class MailHandler
default: default:
return false; return false;
} }
return false;
} }
/** /**
@ -361,11 +359,8 @@ class MailHandler
\fwrite($con, $mail->bodyMime); \fwrite($con, $mail->bodyMime);
$result = \pclose($con); $result = \pclose($con);
if ($result !== 0) {
return false;
}
return true; return $result === 0;
} }
/** /**
@ -391,7 +386,10 @@ class MailHandler
//This sets the SMTP envelope sender which gets turned into a return-path header by the receiver //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
// CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
$params = null; $params = null;
if (!empty($mail->sender) && EmailValidator::isValid($mail->sender) && StringUtils::isShellSafe($mail->sender)) { if (!empty($mail->sender)
&& EmailValidator::isValid($mail->sender)
&& StringUtils::isShellSafe($mail->sender)
) {
$params = \sprintf('-f%s', $mail->sender); $params = \sprintf('-f%s', $mail->sender);
} }
@ -400,7 +398,6 @@ class MailHandler
\ini_set('sendmail_from', $mail->sender); \ini_set('sendmail_from', $mail->sender);
} }
$result = false;
$result = $this->mailPassthru($to, $mail, $header, $params); $result = $this->mailPassthru($to, $mail, $header, $params);
if (isset($oldFrom)) { if (isset($oldFrom)) {
@ -478,11 +475,7 @@ class MailHandler
$this->smtp->close(); $this->smtp->close();
} }
if (!empty($badRcpt)) { return empty($badRcpt);
return false;
}
return true;
} }
/** /**