Branch 'pykolab-0.5' - 2 commits - pykolab/auth wallace/modules.py

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Tue Sep 4 11:40:47 CEST 2012


 pykolab/auth/ldap/__init__.py |    7 ++++++-
 wallace/modules.py            |    7 ++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 3275ba41c56776fdc5193f4f6d1a609902a6a867
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Tue Sep 4 10:40:00 2012 +0100

    Correctly pass on the original recipients to the SMTP forwarding

diff --git a/wallace/modules.py b/wallace/modules.py
index c523eba..8a843e3 100644
--- a/wallace/modules.py
+++ b/wallace/modules.py
@@ -254,12 +254,13 @@ def cb_action_ACCEPT(module, filepath):
 
     smtp = smtplib.SMTP("localhost", 10027)
 
+    if conf.debuglevel > 8:
+        smtp.set_debuglevel(True)
+
     try:
         smtp.sendmail(
                 formataddr(envelope_sender[0]),
-                COMMASPACE.join(
-                        [formataddr(recipient) for recipient in recipients]
-                    ),
+                [formataddr(recipient) for recipient in recipients],
                 message.as_string()
             )
 


commit 919b7fd80416f9b9d59de7f3cfea2eb3f64efe7a
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Tue Aug 28 13:29:09 2012 +0100

    Preserve any secondary recipient email address attribute values that may have already been specified (#973)

diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index a7be76c..18ac294 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -528,7 +528,7 @@ class LDAP(pykolab.base.Base):
         if not entry.has_key('preferredlanguage'):
             want_attrs.append('preferredlanguage')
 
-        # If we wanted anything, now is the type to get it.
+        # If we wanted anything, now is the time to get it.
         if len(want_attrs) > 0:
             log.debug(_("Attributes %r are not yet available for entry %r") % (
                         want_attrs,
@@ -710,6 +710,11 @@ class LDAP(pykolab.base.Base):
             log.debug(_("Recipient policy composed the following set of secondary " + \
                     "email addresses: %r") % (secondary_mail_addresses), level=8)
 
+            if entry.has_key(secondary_mail_attribute):
+                if isinstance(entry[secondary_mail_attribute], list):
+                    secondary_mail_addresses.extend(entry[secondary_mail_attribute])
+                else:
+                    secondary_mail_addresses.append(entry[secondary_mail_attribute])
 
             if not secondary_mail_addresses == None:
                 log.debug(





More information about the commits mailing list