Commit 6efec852 authored by Xavier Guimard's avatar Xavier Guimard

Install new SMTP options (#1206)

parent 6cb301c5
......@@ -23,7 +23,7 @@ use constant HANDLERSECTION => "handler";
use constant MANAGERSECTION => "manager";
use constant SESSIONSEXPLORERSECTION => "sessionsExplorer";
use constant APPLYSECTION => "apply";
our $hashParameters = qr/^(?:(?:l(?:o(?:ca(?:lSessionStorageOption|tionRule)|goutService)|dapExportedVar|wp(?:Ssl)?Opt)|(?:(?:d(?:emo|bi)|facebook|webID)ExportedVa|exported(?:Heade|Va))r|c(?:as(?:StorageOption|Attribute)|ustomAddParam|ombModule)|g(?:r(?:antSessionRule|oup)|lobalStorageOption)|n(?:otificationStorageOption|ginxCustomHandler)|re(?:moteGlobalStorageOption|loadUrl)|CAS_proxiedService|macro)s|o(?:idc(?:RPMetaData(?:(?:Option(?:sExtraClaim)?|ExportedVar)s|Node)|OPMetaData(?:(?:ExportedVar|Option)s|J(?:SON|WKS)|Node)|S(?:erviceMetaDataAuthnContext|torageOptions))|penIdExportedVars)|s(?:aml(?:S(?:PMetaData(?:(?:ExportedAttribute|Option)s|Node|XML)|torageOptions)|IDPMetaData(?:(?:ExportedAttribute|Option)s|Node|XML))|essionDataToRemember|laveExportedVars)|p(?:ersistentStorageOptions|o(?:rtalSkinRules|st))|a(?:uthChoiceModules|pplicationList)|v(?:hostOptions|irtualHost)|SSLVarIf)$/;
our $hashParameters = qr/^(?:(?:l(?:o(?:ca(?:lSessionStorageOption|tionRule)|goutService)|dapExportedVar|wp(?:Ssl)?Opt)|(?:(?:d(?:emo|bi)|facebook|webID)ExportedVa|exported(?:Heade|Va))r|c(?:as(?:StorageOption|Attribute)|ustomAddParam|ombModule)|g(?:r(?:antSessionRule|oup)|lobalStorageOption)|n(?:otificationStorageOption|ginxCustomHandler)|re(?:moteGlobalStorageOption|loadUrl)|CAS_proxiedService|macro)s|o(?:idc(?:RPMetaData(?:(?:Option(?:sExtraClaim)?|ExportedVar)s|Node)|OPMetaData(?:(?:ExportedVar|Option)s|J(?:SON|WKS)|Node)|S(?:erviceMetaDataAuthnContext|torageOptions))|penIdExportedVars)|s(?:aml(?:S(?:PMetaData(?:(?:ExportedAttribute|Option)s|Node|XML)|torageOptions)|IDPMetaData(?:(?:ExportedAttribute|Option)s|Node|XML))|essionDataToRemember|laveExportedVars)|p(?:ersistentStorageOptions|o(?:rtalSkinRules|st))|a(?:uthChoiceModules|pplicationList)|v(?:hostOptions|irtualHost)|S(?:MTPTLSOpts|SLVarIf))$/;
our @sessionTypes = ( 'remoteGlobal', 'cas', 'global', 'localSession', 'persistent', 'saml', 'oidc' );
......
......@@ -229,6 +229,7 @@ sub defaultValues {
'slaveAuthnLevel' => 2,
'slaveExportedVars' => {},
'SMTPServer' => '',
'SMTPTLS' => '',
'SSLAuthnLevel' => 5,
'successLoginNumber' => 5,
'timeout' => 72000,
......
......@@ -20,7 +20,7 @@ our $specialNodeHash = {
};
our $doubleHashKeys = 'issuerDBGetParameters';
our $simpleHashKeys = '(?:(?:l(?:o(?:calSessionStorageOption|goutService)|dapExportedVar|wp(?:Ssl)?Opt)|c(?:as(?:StorageOption|Attribute)|ustomAddParam|ombModule)|(?:(?:d(?:emo|bi)|facebook|webID)E|e)xportedVar|g(?:r(?:antSessionRule|oup)|lobalStorageOption)|n(?:otificationStorageOption|ginxCustomHandler)|p(?:ersistentStorageOption|ortalSkinRule)|re(?:moteGlobalStorageOption|loadUrl)|CAS_proxiedService|macro)s|o(?:idcS(?:erviceMetaDataAuthnContext|torageOptions)|penIdExportedVars)|s(?:(?:amlStorageOption|laveExportedVar)s|essionDataToRemember)|a(?:uthChoiceModules|pplicationList)|SSLVarIf)';
our $simpleHashKeys = '(?:(?:l(?:o(?:calSessionStorageOption|goutService)|dapExportedVar|wp(?:Ssl)?Opt)|c(?:as(?:StorageOption|Attribute)|ustomAddParam|ombModule)|(?:(?:d(?:emo|bi)|facebook|webID)E|e)xportedVar|g(?:r(?:antSessionRule|oup)|lobalStorageOption)|n(?:otificationStorageOption|ginxCustomHandler)|p(?:ersistentStorageOption|ortalSkinRule)|re(?:moteGlobalStorageOption|loadUrl)|CAS_proxiedService|macro)s|o(?:idcS(?:erviceMetaDataAuthnContext|torageOptions)|penIdExportedVars)|s(?:(?:amlStorageOption|laveExportedVar)s|essionDataToRemember)|a(?:uthChoiceModules|pplicationList)|S(?:MTPTLSOpts|SLVarIf))';
our $specialNodeKeys = '(?:(?:saml(?:ID|S)|oidc[OR])PMetaDataNode|virtualHost)s';
our $oidcOPMetaDataNodeKeys = 'oidcOPMetaData(?:Options(?:C(?:lient(?:Secret|ID)|heckJWTSignature|onfigurationURI)|TokenEndpointAuthMethod|(?:JWKSTimeou|Promp)t|I(?:DTokenMaxAge|con)|S(?:toreIDToken|cope)|U(?:iLocales|seNonce)|Display(?:Name)?|AcrValues|MaxAge)|ExportedVars|J(?:SON|WKS))';
our $oidcRPMetaDataNodeKeys = 'oidcRPMetaData(?:Options(?:I(?:DToken(?:Expiration|SignAlg)|con)|Logout(?:SessionRequired|Type|Url)|AccessTokenExpiration|R(?:edirectUris|ule)|Client(?:Secret|ID)|BypassConsent|DisplayName|ExtraClaims|UserIDAttr)|ExportedVars)';
......
......@@ -2886,12 +2886,36 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
'SMTPAuthUser' => {
'type' => 'text'
},
'SMTPPort' => {
'type' => 'int'
},
'SMTPServer' => {
'default' => '',
'test' =>
qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)|(?:[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+))(?::\d+)?)?$/,
'type' => 'text'
},
'SMTPTLS' => {
'default' => '',
'select' => [
{
'k' => '',
'v' => 'none'
},
{
'k' => 'starttls',
'v' => 'SMTP + STARTTLS'
},
{
'k' => 'ssl',
'v' => 'SMTPS'
}
],
'type' => 'select'
},
'SMTPTLSOpts' => {
'type' => 'keyTextContainer'
},
'soapConfigServer' => {
'default' => 0,
'type' => 'bool'
......
......@@ -932,6 +932,24 @@ sub attributes {
test => qr/^(?:$Regexp::Common::URI::RFC2396::host(?::\d+)?)?$/,
documentation => 'SMTP Server',
},
SMTPPort => {
type => 'int',
documentation => 'Fix SMTP port',
},
SMTPTLS => {
type => 'select',
default => '',
select => [
{ k => '', v => 'none' },
{ k => 'starttls', v => 'SMTP + STARTTLS' },
{ k => 'ssl', v => 'SMTPS' },
],
documentation => 'TLS protocol to use with SMTP',
},
SMTPTLSOpts => {
type => 'keyTextContainer',
documentation => 'TLS/SSL options for SMTP',
},
SMTPAuthUser => {
type => 'text',
documentation => 'Login to use to send mails',
......
......@@ -559,8 +559,9 @@ sub tree {
title => 'SMTP',
form => 'simpleInputContainer',
nodes => [
'SMTPServer', 'SMTPAuthUser',
'SMTPAuthPass'
'SMTPServer', 'SMTPPort',
'SMTPAuthUser', 'SMTPAuthPass',
'SMTPTLS', 'SMTPTLSOpts',
]
},
{
......
......@@ -637,7 +637,10 @@
"SMTP": "SMTP",
"SMTPAuthPass": "SMTP password",
"SMTPAuthUser": "SMTP user",
"SMTPPort": "SMTP port",
"SMTPServer": "SMTP server",
"SMTPTLS": "SSL/TLS protocol",
"SMTPTLSOpts": "SSL/TLS options",
"soapConfigServer": "SOAP configuration server",
"soapSessionServer": "SOAP session server",
"specialRule": "Special rule",
......
......@@ -637,7 +637,10 @@
"SMTP": "SMTP",
"SMTPAuthPass": "Mot de passe SMTP",
"SMTPAuthUser": "Utilisateur SMTP",
"SMTPPort": "Port SMTP",
"SMTPServer": "Serveur SMTP",
"SMTPTLS": "Protocole SSL/TLS",
"SMTPTLSOpts": "Options SSL/TLS",
"soapConfigServer": "Serveur de configurations SOAP",
"soapSessionServer": "Serveur de sessions SOAP",
"specialRule": "Règle spécifique",
......
......@@ -59,7 +59,7 @@ has transport => (
else {
$transport = Email::Sender::Transport::SMTP->new(
host => $conf->{SMTPServer},
port => $conf->{SMTPPort} || 25,
( $conf->{SMTPPort} ? ( port => $conf->{SMTPPort} ) : () ),
(
$conf->{SMTPAuthUser}
? (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment