From f8596ce463863dc6defb5dac84f5b226c45cb419 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 10 Jun 2011 19:52:25 -0400 Subject: Refactor MTA alias creation. * Create an IMailTransportAgentAliases utility that contains all the logic for generating all the aliases for a mailing list, both the fully-qualified ones and the local-part ones. * Add -f and -s options to `bin/mailman aliases` to facilitate outputing the aliases in other formats than the configured one, and for printing out a simple list of the aliases. * IMailTransportAgentAliases -> IMailTransportAgentLifecycle; also add a new definition for IMailTransportAgentAliases --- src/mailman/interfaces/mta.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/mailman/interfaces/mta.py') diff --git a/src/mailman/interfaces/mta.py b/src/mailman/interfaces/mta.py index 2aeb65172..0e6fd0938 100644 --- a/src/mailman/interfaces/mta.py +++ b/src/mailman/interfaces/mta.py @@ -23,6 +23,7 @@ __metaclass__ = type __all__ = [ 'IMailTransportAgentAliases', 'IMailTransportAgentDelivery', + 'IMailTransportAgentLifecycle', ] @@ -42,7 +43,26 @@ class SomeRecipientsFailed(MailmanError): class IMailTransportAgentAliases(Interface): - """Interface to the MTA aliases generator.""" + """Interface to the MTA utility for generating all the aliases.""" + + def aliases(mlist): + """Generate all the aliases for the mailing list. + + This method is a generator. The posting address will be returned + first, followed by the rest of the aliases in alphabetical order. + """ + + def destinations(mlist): + """Generate just the local parts for the mailing list aliases. + + This method is a generator. The posting address will be returned + first, followed by the rest of the aliases in alphabetical order. + """ + + + +class IMailTransportAgentLifecycle(Interface): + """Interface to the MTA for creating and deleting a mailing list.""" def create(mlist): """Tell the MTA that the mailing list was created.""" -- cgit v1.2.3-70-g09d2