diff --git a/core/default_settings/app_defaults.php b/core/default_settings/app_defaults.php index 0c982c4c7a..84179aaa9e 100644 --- a/core/default_settings/app_defaults.php +++ b/core/default_settings/app_defaults.php @@ -189,6 +189,14 @@ if ($domains_processed == 1) { $array[$x]['default_setting_enabled'] = 'true'; $array[$x]['default_setting_description'] = ''; $x++; + $array[$x]['default_setting_uuid'] = 'e1c17089-1e75-4e46-9e59-4748bb6a6cec'; + $array[$x]['default_setting_category'] = 'email'; + $array[$x]['default_setting_subcategory'] = 'smtp_validate_certificate'; + $array[$x]['default_setting_name'] = 'bolean'; + $array[$x]['default_setting_value'] = 'true'; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = 'set to false to ignore SSL certificate warnings e.g. for self-signed certificates'; + $x++; $array[$x]['default_setting_uuid'] = '8a07ab78-f386-482c-85dd-7ce8127597d6'; $array[$x]['default_setting_category'] = 'login'; $array[$x]['default_setting_subcategory'] = 'password_reset_key'; diff --git a/secure/fax_to_email.php b/secure/fax_to_email.php index 476a34b83d..80e040153c 100644 --- a/secure/fax_to_email.php +++ b/secure/fax_to_email.php @@ -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 } diff --git a/secure/v_mailto.php b/secure/v_mailto.php index ce0a395e0b..3ad81519e3 100644 --- a/secure/v_mailto.php +++ b/secure/v_mailto.php @@ -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'];