Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117906761
D136.1775390606.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D136.1775390606.diff
View Options
diff --git a/pykolab/plugins/recipientpolicy/__init__.py b/pykolab/plugins/recipientpolicy/__init__.py
--- a/pykolab/plugins/recipientpolicy/__init__.py
+++ b/pykolab/plugins/recipientpolicy/__init__.py
@@ -70,6 +70,11 @@
user_attrs['preferredlanguage'] = default_locale
+ # strip whitespace from common attribs used to build the address
+ for attr in ['surname', 'sn', 'givenname']:
+ if attr in user_attrs:
+ user_attrs[attr] = user_attrs[attr].strip()
+
try:
mail = kw['primary_mail'] % user_attrs
mail = utils.translate(mail, user_attrs['preferredlanguage'])
@@ -122,7 +127,7 @@
for attr in [ 'givenname', 'sn', 'surname' ]:
try:
- user_attrs[attr] = utils.translate(user_attrs[attr], user_attrs['preferredlanguage'])
+ user_attrs[attr] = utils.translate(user_attrs[attr].strip(), user_attrs['preferredlanguage'])
except Exception, errmsg:
log.error(_("An error occurred in composing the secondary mail attribute for entry %r") % (user_attrs['id']))
if conf.debuglevel > 8:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 5, 12:03 PM (5 d, 5 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18833393
Default Alt Text
D136.1775390606.diff (1 KB)
Attached To
Mode
D136: Trim spaces in surname/givenname/sn when generating mail/alias (#5360)
Attached
Detach File
Event Timeline