Commit c36ea848 authored by Côme Chilliet's avatar Côme Chilliet

🚑 fix(postfix) Small fixes on contributed code and schema

issue #5761
parent b8226e34
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
This code is part of FusionDirectory (http://www.fusiondirectory.org/) This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier Copyright (C) 2003-2010 Cajus Pollmeier
Copyright (C) 2011-2016 FusionDirectory Copyright (C) 2011-2018 FusionDirectory
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,20 +21,27 @@ ...@@ -21,20 +21,27 @@
class CatchallDomainAttribute extends StringAttribute class CatchallDomainAttribute extends StringAttribute
{ {
function fixPostValue ($value) /*! \brief Return the ldap value in the correct intern format value
*
* \param $ldapValue The value as found in the LDAP
*/
function inputValue ($ldapValue)
{ {
/* prepend '@' for postfix catchall mapping */ /* remove initial '@' from value */
if ($value) { return preg_replace('/^@/', '', $ldapValue);
return '@'.parent::fixPostValue($value);
} else {
return $value;
}
} }
function displayValue ($value) /*! \brief Computes LDAP value
*/
function computeLdapValue ()
{ {
/* remove initial '@' from display */ return '@'.$this->getValue();
return '@' == substr($value, 0, 1) ? substr($value, 1) : $value; }
function setValue ($value)
{
/* remove initial '@' if needed */
return parent::setValue(preg_replace('/^@/', '', $value));
} }
} }
...@@ -120,8 +127,14 @@ class servicePostfix extends simpleService ...@@ -120,8 +127,14 @@ class servicePostfix extends simpleService
_('Catchall table'), _('Catchall table'), _('Catchall table'), _('Catchall table'),
'fdPostfixCatchallTable', 'fdPostfixCatchallTable', 'fdPostfixCatchallTable', 'fdPostfixCatchallTable',
array( array(
new CatchallDomainAttribute ('Domain', '', 'fdCatchallTableDomain'), new CatchallDomainAttribute (
new MailAttribute ('Recipient', '', 'fdCatchallTableRecipient') _('Domain'), _('Domain concerned by this catchall rule'),
'fdCatchallTableDomain', TRUE
),
new MailAttribute (
_('Recipient'), _('Recipient mail address for this catchall rule'),
'fdCatchallTableRecipient', TRUE
)
) )
) )
) )
......
...@@ -72,13 +72,13 @@ attributetype ( 1.3.6.1.4.1.38414.10.12.2 NAME 'fdTransportTableRule' ...@@ -72,13 +72,13 @@ attributetype ( 1.3.6.1.4.1.38414.10.12.2 NAME 'fdTransportTableRule'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE) SINGLE-VALUE)
attributetype ( 1.3.6.1.4.1.38414.10.11.12 NAME 'fdCatchallTableDomain' attributetype ( 1.3.6.1.4.1.38414.10.13.1 NAME 'fdCatchallTableDomain'
DESC 'FusionDirectory - postfix catchall table domain' DESC 'FusionDirectory - postfix catchall table domain'
EQUALITY caseExactIA5Match EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE) SINGLE-VALUE)
attributetype ( 1.3.6.1.4.1.38414.10.11.13 NAME 'fdCatchallTableRecipient' attributetype ( 1.3.6.1.4.1.38414.10.13.2 NAME 'fdCatchallTableRecipient'
DESC 'FusionDirectory - postfix catchall table recipient' DESC 'FusionDirectory - postfix catchall table recipient'
EQUALITY caseExactIA5Match EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
...@@ -99,7 +99,7 @@ objectclass (1.3.6.1.4.1.38414.10.2.4 NAME 'fdPostfixTransportTable' ...@@ -99,7 +99,7 @@ objectclass (1.3.6.1.4.1.38414.10.2.4 NAME 'fdPostfixTransportTable'
MUST ( fdTransportTableMatch $ fdTransportTableRule ) MUST ( fdTransportTableMatch $ fdTransportTableRule )
MAY ( ) ) MAY ( ) )
objectclass (1.3.6.1.4.1.38414.10.2.6 NAME 'fdPostfixCatchallTable' objectclass (1.3.6.1.4.1.38414.10.2.5 NAME 'fdPostfixCatchallTable'
DESC 'FusionDirectory - Postfix catchall table line' DESC 'FusionDirectory - Postfix catchall table line'
MUST ( fdCatchallTableDomain $ fdCatchallTableRecipient ) MUST ( fdCatchallTableDomain $ fdCatchallTableRecipient )
MAY ( ) ) MAY ( ) )
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