Merge pull request #285 from Nutomic/ssl-sendmail

Use TLS to send emails
pull/289/head
David Goodwin 5 years ago committed by GitHub
commit d788c6ac99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -171,6 +171,9 @@ $CONF['smtp_port'] = '25';
// Used in the HELO when sending emails from Postfix Admin
$CONF['smtp_client'] = '';
// Set 'YES' to use TLS when sending emails.
$CONF['smtp_sendmail_tls'] = 'NO';
// Encrypt
// In what way do you want the passwords to be crypted?
// md5crypt = internal postfix admin md5

@ -1398,6 +1398,16 @@ function smtp_mail($to, $from, $data, $password = "", $body = "") {
return false;
} else {
smtp_get_response($fh);
if (Config::bool('smtp_sendmail_tls')) {
fputs($fh, "STARTTLS\r\n");
smtp_get_response($fh);
stream_set_blocking ($fh, true);
stream_socket_enable_crypto($fh, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);
stream_set_blocking ($fh, true);
}
fputs($fh, "EHLO $smtp_server\r\n");
smtp_get_response($fh);

Loading…
Cancel
Save