EmailDistributor.resolvers option should set to include_missing=False
|Reported by:||Jun Omae||Owned by:||Jun Omae|
EmailDistributor.resovlers returns all components which are implemented
IEmailAddressResolver. The behavior is not useful. I consider we should use only configured resolvers.
>>> from trac.test import EnvironmentStub >>> from trac.loader import load_components >>> from trac.notification.mail import EmailDistributor >>> from trac.notification.tests.mail import TestEmailAddressResolver >>> env = EnvironmentStub() >>> EmailDistributor(env).resolvers [<Component trac.notification.mail.SessionEmailResolver>, <Component trac.notification.tests.mail.TestEmailAddressResolver>]
Also, another issue is that
include_missing return the option's documentation string.
>>> EmailDistributor.resolvers.include_missing 'Comma seperated list of email resolver components in the order\n they will be called. If an email address is resolved, the remaining\n resolvers will not be called.\n '
diff --git a/trac/notification/mail.py b/trac/notification/mail.py index 6878fbebf..c3421eaf9 100644
a b class EmailDistributor(Component): 280 280 resolvers = OrderedExtensionsOption('notification', 281 281 'email_address_resolvers', IEmailAddressResolver, 282 282 'SessionEmailResolver', 283 """Comma seperated list of email resolver components in the order 283 include_missing=False, 284 doc="""Comma seperated list of email resolver components in the order 284 285 they will be called. If an email address is resolved, the remaining 285 286 resolvers will not be called. 286 287 """)