Commit a67b9be5 authored by dockx thibault's avatar dockx thibault
Browse files

Merge branch '35-integrator-mail-adds-conditions-to-mail-security-and-authentication' into 'dev'

Resolve "[Integrator] - Mail - Adds conditions to mail security and authentication"

See merge request !45
2 merge requests!52:sparkles: Releasing Fusiondirectory Integrator 1.2,!45Resolve "[Integrator] - Mail - Adds conditions to mail security and authentication"
Pipeline #30044 passed with stages
in 3 minutes and 3 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 = [
'ssl' => [
'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