Fax email fix for master branch (#2023)

* allow bypass of certificate validation

* Update app_defaults.php

change to match

* Update app_defaults.php
This commit is contained in:
jebsolutions
2016-10-31 16:19:41 -04:00
committed by FusionPBX
parent 78b1f978f0
commit 130147990e
3 changed files with 41 additions and 0 deletions

View File

@@ -571,6 +571,23 @@ if(!function_exists('fax_split_dtmf')) {
else {
$mail->IsSMTP(); // set mailer to use SMTP
}
//optionally skip certificate validation
if (isset($_SESSION['email']['smtp_validate_certificate'])) {
if ($_SESSION['email']['smtp_validate_certificate']['boolean'] == "false") {
// this works around TLS certificate problems e.g. self-signed certificates
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
}
}
if ($smtp['auth'] == "true") {
$mail->SMTPAuth = $smtp['auth']; // turn on/off SMTP authentication
}

View File

@@ -189,6 +189,22 @@
default: $mail->IsSMTP(); break;
}
} else $mail->IsSMTP();
// optional bypass TLS certificate check e.g. for self-signed certificates
if (isset($_SESSION['email']['smtp_validate_certificate'])) {
if ($_SESSION['email']['smtp_validate_certificate']['boolean'] == "false") {
// this is needed to work around TLS certificate problems
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
}
}
$mail->SMTPAuth = $smtp['auth'];
$mail->Host = $smtp['host'];
if ($smtp['port']!=0) $mail->Port=$smtp['port'];