mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-08 21:28:40 +00:00
continue drafting mail handler
This commit is contained in:
parent
91fde08f52
commit
b7131f34e1
|
|
@ -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 '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user