diff options
Diffstat (limited to 'src/mailman/mta/postfix.py')
| -rw-r--r-- | src/mailman/mta/postfix.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mailman/mta/postfix.py b/src/mailman/mta/postfix.py index 32bdb8268..c04e38f02 100644 --- a/src/mailman/mta/postfix.py +++ b/src/mailman/mta/postfix.py @@ -17,7 +17,7 @@ """Creation/deletion hooks for the Postfix MTA.""" -from __future__ import absolute_import, unicode_literals +from __future__ import absolute_import, print_function, unicode_literals __metaclass__ = type __all__ = [ @@ -31,7 +31,7 @@ import logging from flufl.lock import Lock from operator import attrgetter from zope.component import getUtility -from zope.interface import implements +from zope.interface import implementer from mailman.config import config from mailman.interfaces.listmanager import IListManager @@ -55,11 +55,10 @@ class _FakeList: +@implementer(IMailTransportAgentLifecycle) class LMTP: """Connect Mailman to Postfix via LMTP.""" - implements(IMailTransportAgentLifecycle) - def create(self, mlist): """See `IMailTransportAgentLifecycle`.""" # We can ignore the mlist argument because for LMTP delivery, we just @@ -117,23 +116,24 @@ class LMTP: for list_name, mail_host in list_manager.name_components: mlist = _FakeList(list_name, mail_host) by_domain.setdefault(mlist.mail_host, []).append(mlist) - print >> fp, """\ + print("""\ # AUTOMATICALLY GENERATED BY MAILMAN ON {0} # # This file is generated by Mailman, and is kept in sync with the binary hash # file. YOU SHOULD NOT MANUALLY EDIT THIS FILE unless you know what you're # doing, and can keep the two files properly in sync. If you screw it up, # you're on your own. -""".format(now().replace(microsecond=0)) +""".format(now().replace(microsecond=0)), file=fp) sort_key = attrgetter('list_name') for domain in sorted(by_domain): - print >> fp, """\ -# Aliases which are visible only in the @{0} domain.""".format(domain) + print("""\ +# Aliases which are visible only in the @{0} domain.""".format(domain), + file=fp) for mlist in sorted(by_domain[domain], key=sort_key): utility = getUtility(IMailTransportAgentAliases) aliases = list(utility.aliases(mlist)) width = max(len(alias) for alias in aliases) + 3 - print >> fp, ALIASTMPL.format(aliases.pop(0), config, width) + print(ALIASTMPL.format(aliases.pop(0), config, width), file=fp) for alias in aliases: - print >> fp, ALIASTMPL.format(alias, config, width) - print >> fp + print(ALIASTMPL.format(alias, config, width), file=fp) + print(file=fp) |
