Edgewall Software

Changes between Version 2 and Version 3 of TracDev/Proposals/AdvancedNotification/IEmailAddressResolver


Ignore:
Timestamp:
Oct 6, 2013, 12:38:23 PM (11 years ago)
Author:
Peter Suter
Comment:

Fix example (unbind from ldap before returning); target milestone:1.1.2

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/Proposals/AdvancedNotification/IEmailAddressResolver

    v2 v3  
    11== Extension Point : ''IEmailAddressResolver'' ==
    22
    3 ||'''Interface'''||''IEmailAddressResolver''||'''Since'''||[wiki:TracDev/ApiChanges/1.1.1#IEmailAddressResolver 1.1.1]||
    4 ||'''Module'''||''trac.notification''||'''Source'''||[source:trunk/trac/notification/api.py#/IEmailAddressResolver api.py]||
     3||'''Interface'''||''IEmailAddressResolver''||'''Since'''||[wiki:TracDev/ApiChanges/1.1.2#IEmailAddressResolver 1.1.2]||
     4||'''Module'''||''trac.notification''||'''Source'''||[source:psuter/trac/notification/api.py@advanced-notification-mail-distribution#/IEmailAddressResolver api.py]||
    55
    66The ''IEmailAddressResolver'' is a fallback mechanism for determining which email address should be used to send [TracNotification notifications].
     
    3939   
    4040    def get_address_for_session(sid, authenticated):
     41        address = None
    4142        ld = ldap.initialize('ldap://localhost:1390')
    4243        ld.simple_bind_s()
     
    4647                                     ['mail']):
    4748            if 'mail' in entry:
    48                 return entry['mail']
     49                address = entry['mail']
    4950        ld.unbind_s()
     51        return address
    5052}}}
    5153
     
    6567   * DONE Renamed `get_address_for_name()` to `get_address_for_session()`.
    6668   * DONE Other distributors can not use the same interface (according to comment in th:AnnouncerPlugin's `XmppDistributor`) so this is email specific.
    67    * TODO: Make it usable by multiple distributors?
     69   * TODO: Make it usable by distributors other than email?