Browse Source

Add option to set a custom CA certificate

Neraud 6 months ago
parent
commit
6019723c9f
1 changed files with 7 additions and 1 deletions
  1. 7 1
      init.php

+ 7 - 1
init.php

@@ -50,7 +50,13 @@ class mailer_smtp extends Plugin {
 				        'allow_self_signed' => true
 				    )
 				);
-			}
+			} elseif (defined('SMTP_CA_FILE') && SMTP_CA_FILE) {
+				$phpmailer->SMTPOptions = array(
+				    'ssl' => array(
+                        'cafile' => SMTP_CA_FILE
+				    )
+				);
+            }
 
 			$from_name = $params["from_name"] ? $params["from_name"] : SMTP_FROM_NAME;
 			$from_address = $params["from_address"] ? $params["from_address"] : SMTP_FROM_ADDRESS;