mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-12 04:24:12 +01:00
N°5155 - Email by SMTP with self-signed certificate
This commit is contained in:
@@ -555,6 +555,22 @@ class Config
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
),
|
||||
'email_transport_smtp.allow_self_signed' => array(
|
||||
'type' => 'bool',
|
||||
'description' => 'Allow self signed peer certificates',
|
||||
'default' => false,
|
||||
'value' => false,
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
),
|
||||
'email_transport_smtp.verify_peer' => array(
|
||||
'type' => 'bool',
|
||||
'description' => 'Verify peer certificate',
|
||||
'default' => false,
|
||||
'value' => false,
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
),
|
||||
'email_css' => array(
|
||||
'type' => 'string',
|
||||
'description' => 'CSS that will override the standard stylesheet used for the notifications',
|
||||
|
||||
@@ -159,11 +159,14 @@ class EmailSwiftMailer extends EMail
|
||||
$sEncryption = static::$m_oConfig->Get('email_transport_smtp.encryption');
|
||||
$sUserName = static::$m_oConfig->Get('email_transport_smtp.username');
|
||||
$sPassword = static::$m_oConfig->Get('email_transport_smtp.password');
|
||||
$bAllowSelfSigned = static::$m_oConfig->Get('email_transport_smtp.allow_self_signed');
|
||||
$bVerifyPeer = static::$m_oConfig->Get('email_transport_smtp.verify_peer');
|
||||
|
||||
$oTransport = new Swift_SmtpTransport($sHost, $sPort, $sEncryption);
|
||||
if (strlen($sUserName) > 0) {
|
||||
$oTransport->setUsername($sUserName);
|
||||
$oTransport->setPassword($sPassword);
|
||||
$oTransport->setStreamOptions(array('ssl' => array('allow_self_signed' => $bAllowSelfSigned, 'verify_peer' => $bVerifyPeer)));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user