Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37417977
en ru br
Репозитории ALT
S:2.1.39-alt1
5.1: 2.1.12-alt2
4.1: 2.1.10-alt0.3.1.M41.1
4.0: 2.1.9-alt6.M40.1
3.0: 2.1.6-alt1
www.altlinux.org/Changes

Группа :: Система/Серверы
Пакет: mailman

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: mailman-2.1.9-alt-postfix_maps.patch
Скачать


diff --git a/mailman/Mailman/Defaults.py.in b/mailman/Mailman/Defaults.py.in
index 142f5d8..df10473 100644
--- a/mailman/Mailman/Defaults.py.in
+++ b/mailman/Mailman/Defaults.py.in
@@ -394,6 +394,7 @@ POSTFIX_STYLE_VIRTUAL_DOMAINS = []
 # separating space), so it must be appropriate for os.system().
 POSTFIX_ALIAS_CMD = '/usr/sbin/postalias'
 POSTFIX_MAP_CMD = '/usr/sbin/postmap'
+POSTFIX_CONF_CMD = '/usr/sbin/postconf'
 
 # Ceiling on the number of recipients that can be specified in a single SMTP
 # transaction.  Set to 0 to submit the entire recipient list in one
diff --git a/mailman/Mailman/MTA/Postfix.py b/mailman/Mailman/MTA/Postfix.py
index 33cb9a4..6161f58 100644
--- a/mailman/Mailman/MTA/Postfix.py
+++ b/mailman/Mailman/MTA/Postfix.py
@@ -45,19 +45,24 @@ except NameError:
 
 def _update_maps():
     msg = 'command failed: %s (status: %s, %s)'
-    acmd = mm_cfg.POSTFIX_ALIAS_CMD + ' ' + ALIASFILE
-    status = (os.system(acmd) >> 8) & 0xff
-    if status:
-        errstr = os.strerror(status)
-        syslog('error', msg, acmd, status, errstr)
-        raise RuntimeError, msg % (acmd, status, errstr)
-    if os.path.exists(VIRTFILE):
-        vcmd = mm_cfg.POSTFIX_MAP_CMD + ' ' + VIRTFILE
-        status = (os.system(vcmd) >> 8) & 0xff
-        if status:
-            errstr = os.strerror(status)
-            syslog('error', msg, vcmd, status, errstr)
-            raise RuntimeError, msg % (vcmd, status, errstr)
+    ccmd = mm_cfg.POSTFIX_CONF_CMD + ' -h alias_maps'
+    for mapfile in os.popen(ccmd).readline().rstrip('\n').split(','):
+	if mapfile == ALIASFILE or mapfile.endswith(':' + ALIASFILE):
+	    acmd = mm_cfg.POSTFIX_ALIAS_CMD + ' ' + mapfile
+	    status = (os.system(acmd) >> 8) & 0xff
+	    if status:
+		errstr = os.strerror(status)
+		syslog('error', msg, acmd, status, errstr)
+		raise RuntimeError, msg % (acmd, status, errstr)
+    ccmd = mm_cfg.POSTFIX_CONF_CMD + ' -h virtual_maps'
+    for mapfile in os.popen(ccmd).readline().rstrip('\n').split(','):
+	if (mapfile == VIRTFILE or mapfile.endswith(':' + VIRTFILE)) and os.path.exists(VIRTFILE):
+	    vcmd = mm_cfg.POSTFIX_MAP_CMD + ' ' + mapfile
+	    status = (os.system(vcmd) >> 8) & 0xff
+	    if status:
+		errstr = os.strerror(status)
+		syslog('error', msg, vcmd, status, errstr)
+		raise RuntimeError, msg % (vcmd, status, errstr)
 
 
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin