Verified Commit 65148af4 authored by dockx thibault's avatar dockx thibault
Browse files

:sparkles: Feat(Integrator) - mailLib is now allowing unsecure mail and non...

:sparkles: Feat(Integrator) - mailLib is now allowing unsecure mail and non authentication to server relay

Mail relay server can be un-authenticated and self sign certified.
parent 37ed1d1c
2 merge requests!52:sparkles: Releasing Fusiondirectory Integrator 1.2,!45Resolve "[Integrator] - Mail - Adds conditions to mail security and authentication"
Pipeline #29654 failed with stages
in 1 minute and 20 seconds
Showing with 29 additions and 6 deletions
+29 -6
......@@ -55,12 +55,35 @@ class MailLib
* $this->mail->Helo = '['.$_SERVER['SERVER_ADDR'].']';
*/
$this->mail->SMTPAuth = TRUE;
$this->mail->Username = $_ENV["MAIL_USER"];
$this->mail->Password = $_ENV["MAIL_PASS"];
$this->mail->SMTPSecure = $_ENV["MAIL_SEC"];
$this->mail->Port = $_ENV["MAIL_PORT"];
$this->mail->AuthType = 'LOGIN';
// Authentication mechanism
if ($_ENV["MAIL_AUTH"] == "TRUE") {
$this->mail->SMTPAuth = TRUE;
$this->mail->Username = $_ENV["MAIL_USER"];
$this->mail->Password = $_ENV["MAIL_PASS"];
} else {
$this->mail->SMTPAuth = FALSE;
}
// Security logic about SSL certificate potential verification.
if ($_ENV["MAIL_SEC_VERIFY"] == "TRUE") {
$this->mail->SMTPSecure = $_ENV["MAIL_SEC"];
$this->mail->AuthType = 'LOGIN';
} else {
// Disable SSL certificate verification
$this->mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => FALSE,
'verify_peer_name' => FALSE,
'allow_self_signed' => TRUE
)
);
}
$this->mail->Port = $_ENV["MAIL_PORT"];
if (!empty($this->attachments)) {
foreach ($this->attachments as $attachment) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment