summaryrefslogtreecommitdiff
path: root/Mailman/ListAdmin.py
diff options
context:
space:
mode:
authorbwarsaw2002-07-26 03:27:24 +0000
committerbwarsaw2002-07-26 03:27:24 +0000
commit77a77b1091eca010ef75cab4eb6e5100e4df0598 (patch)
treeafcc8a93c393e5ce487e289f536b166f2e52d1aa /Mailman/ListAdmin.py
parent522c9783dd31452ba64836cdfe9288d4abab8492 (diff)
downloadmailman-77a77b1091eca010ef75cab4eb6e5100e4df0598.tar.gz
mailman-77a77b1091eca010ef75cab4eb6e5100e4df0598.tar.zst
mailman-77a77b1091eca010ef75cab4eb6e5100e4df0598.zip
Diffstat (limited to 'Mailman/ListAdmin.py')
-rw-r--r--Mailman/ListAdmin.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py
index c91124520..adedd54b4 100644
--- a/Mailman/ListAdmin.py
+++ b/Mailman/ListAdmin.py
@@ -33,6 +33,7 @@ from cStringIO import StringIO
import email
from email.MIMEMessage import MIMEMessage
from email.Generator import Generator
+from email.Utils import getaddresses
from Mailman import mm_cfg
from Mailman import Utils
@@ -321,11 +322,22 @@ class ListAdmin:
except IOError, e:
if e.errno <> errno.ENOENT: raise
raise Errors.LostHeldMessage(path)
- # If the address getting the forwarded message is a member of the
- # list, we want the headers of the outer message to be encoded in
- # their language. Otherwise it'll be the preferred language of
- # the mailing list.
- lang = self.getMemberLanguage(addr)
+ # It's possible the addr is a comma separated list of addresses.
+ addrs = getaddresses([addr])
+ if len(addrs) == 1:
+ realname, addr = addrs[0]
+ # If the address getting the forwarded message is a member of
+ # the list, we want the headers of the outer message to be
+ # encoded in their language. Otherwise it'll be the preferred
+ # language of the mailing list.
+ lang = self.getMemberLanguage(addr)
+ else:
+ # Throw away the realnames
+ addr = [a for realname, a in addrs]
+ # Which member language do we attempt to use? We could use
+ # the first match or the first address, but in the face of
+ # ambiguity, let's just use the list's preferred language
+ lang = self.preferred_language
otrans = i18n.get_translation()
i18n.set_language(lang)
try: