summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--init.php8
2 files changed, 11 insertions, 1 deletions
diff --git a/README.md b/README.md
index 65bdd2a..0898929 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,10 @@ per-user).
define('SMTP_SKIP_CERT_CHECKS', false);
// Accept all SSL certificates, use with caution.
+
+ define('SMTP_CA_FILE', '/path/to/ca.crt');
+ // Use a custom CA certificate for SSL/TLS secure connections.
+ // Only used if SMTP_SKIP_CERT_CHECKS is false.
```
At least SMTP_SERVER needs to set for plugin to work.
diff --git a/init.php b/init.php
index e00a5a5..a0823f6 100644
--- a/init.php
+++ b/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;