summaryrefslogtreecommitdiff
path: root/src/mailman/mta/postfix.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-11-04 15:49:08 -0500
committerBarry Warsaw2012-11-04 15:49:08 -0500
commit89f6e779db51478ea95b71f2ad3dc9d7f5f51e05 (patch)
treee1054919eb00e3abf73b4387277c4c79aca52b64 /src/mailman/mta/postfix.py
parent23fca2302ea2a8c5bad0a7aa450ea210ace7cf27 (diff)
downloadmailman-89f6e779db51478ea95b71f2ad3dc9d7f5f51e05.tar.gz
mailman-89f6e779db51478ea95b71f2ad3dc9d7f5f51e05.tar.zst
mailman-89f6e779db51478ea95b71f2ad3dc9d7f5f51e05.zip
Diffstat (limited to 'src/mailman/mta/postfix.py')
-rw-r--r--src/mailman/mta/postfix.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mailman/mta/postfix.py b/src/mailman/mta/postfix.py
index 072581374..ecd71db32 100644
--- a/src/mailman/mta/postfix.py
+++ b/src/mailman/mta/postfix.py
@@ -34,6 +34,7 @@ from zope.component import getUtility
from zope.interface import implementer
from mailman.config import config
+from mailman.config.config import external_configuration
from mailman.interfaces.listmanager import IListManager
from mailman.interfaces.mta import (
IMailTransportAgentAliases, IMailTransportAgentLifecycle)
@@ -60,6 +61,11 @@ class _FakeList:
class LMTP:
"""Connect Mailman to Postfix via LMTP."""
+ def __init__(self):
+ # Locate and read the Postfix specific configuration file.
+ mta_config = external_configuration(config.mta.configuration)
+ self.postmap_command = mta_config.get('postfix', 'postmap_command')
+
def create(self, mlist):
"""See `IMailTransportAgentLifecycle`."""
# We can ignore the mlist argument because for LMTP delivery, we just
@@ -91,7 +97,7 @@ class LMTP:
# one files, still try the other one.
errors = []
for path in (lmtp_path, domains_path):
- command = config.mta.postfix_map_cmd + ' ' + path
+ command = self.postmap_command + ' ' + path
status = (os.system(command) >> 8) & 0xff
if status:
msg = 'command failure: %s, %s, %s'
@@ -124,7 +130,7 @@ class LMTP:
""".format(now().replace(microsecond=0)), file=fp)
for domain in sorted(by_domain):
print("""\
-# Aliases which are visible only in the @{0} domain.""".format(domain),
+# Aliases which are visible only in the @{0} domain.""".format(domain),
file=fp)
for mlist in sorted(by_domain[domain], key=sort_key):
aliases = list(utility.aliases(mlist))