summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-03-26 17:42:43 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-03-26 17:42:43 +0000
commitaa668ab1bc93254dd03f22bbd85736992dbaa07c (patch)
tree84c58193b9f91b392087d24b03372c556e84e333 /pykolab
parent617e4c80a44d1d67208948f72aa58c63e0793f35 (diff)
downloadpykolab-aa668ab1bc93254dd03f22bbd85736992dbaa07c.tar.gz
Normalize secondary mail in order to compare against primary mail, only return any new or unique results. Exploiting case-sensitivity is considered bad karma anyways.
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/plugins/recipientpolicy/__init__.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pykolab/plugins/recipientpolicy/__init__.py b/pykolab/plugins/recipientpolicy/__init__.py
index 5d47067..2baaaf7 100644
--- a/pykolab/plugins/recipientpolicy/__init__.py
+++ b/pykolab/plugins/recipientpolicy/__init__.py
@@ -19,12 +19,12 @@
import pykolab
-conf = pykolab.getConf()
-log = pykolab.getLogger('pykolab.plugins.recipientpolicy')
-
from pykolab import utils
from pykolab.translate import _
+conf = pykolab.getConf()
+log = pykolab.getLogger('pykolab.plugins.recipientpolicy')
+
class KolabRecipientpolicy(object):
"""
Example plugin making quota adjustments given arbitrary conditions.
@@ -103,4 +103,8 @@ class KolabRecipientpolicy(object):
log.warning(_("Attribute substitution for 'alternative_mail' failed in Recipient Policy"))
alternative_mail.append(retval)
+ alternative_mail = utils.normalize(alternative_mail)
+
+ alternative_mail = list(set(alternative_mail))
+
return alternative_mail