diff options
| author | Barry Warsaw | 2008-03-27 05:14:14 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2008-03-27 05:14:14 -0400 |
| commit | 17f286de64cb3373d68c4fefba6d9369b4e3f960 (patch) | |
| tree | 5078531044f0574dfa340a389bd6d0bb9eea717f /mailman/pipeline | |
| parent | de9deb660c5d48a083f0c56916cca6aa0cb010b3 (diff) | |
| download | mailman-17f286de64cb3373d68c4fefba6d9369b4e3f960.tar.gz mailman-17f286de64cb3373d68c4fefba6d9369b4e3f960.tar.zst mailman-17f286de64cb3373d68c4fefba6d9369b4e3f960.zip | |
Diffstat (limited to 'mailman/pipeline')
| -rw-r--r-- | mailman/pipeline/decorate.py | 26 | ||||
| -rw-r--r-- | mailman/pipeline/docs/file-recips.txt | 2 | ||||
| -rw-r--r-- | mailman/pipeline/file_recipients.py | 2 | ||||
| -rw-r--r-- | mailman/pipeline/smtp_direct.py | 4 | ||||
| -rw-r--r-- | mailman/pipeline/to_digest.py | 2 |
5 files changed, 18 insertions, 18 deletions
diff --git a/mailman/pipeline/decorate.py b/mailman/pipeline/decorate.py index 100c1cb6e..387685f12 100644 --- a/mailman/pipeline/decorate.py +++ b/mailman/pipeline/decorate.py @@ -48,21 +48,21 @@ def process(mlist, msg, msgdata): if msgdata.get('personalize'): # Calculate the extra personalization dictionary. Note that the # length of the recips list better be exactly 1. - recips = msgdata.get('recips') - assert isinstance(recips, list) and len(recips) == 1, ( + recips = msgdata.get('recips', []) + assert len(recips) == 1, ( 'The number of intended recipients must be exactly 1') - member = recips[0].lower() - d['user_address'] = member - try: - d['user_delivered_to'] = mlist.getMemberCPAddress(member) + recipient = recips[0].lower() + user = config.db.user_manager.get_user(recipient) + member = mlist.members.get_member(recipient) + d['user_address'] = recipient + if user is not None and member is not None: + d['user_delivered_to'] = member.address.original_address # BAW: Hmm, should we allow this? - d['user_password'] = mlist.getMemberPassword(member) - d['user_language'] = mlist.getMemberLanguage(member) - username = mlist.getMemberName(member) or None - d['user_name'] = username or d['user_delivered_to'] - d['user_optionsurl'] = mlist.GetOptionsURL(member) - except Errors.NotAMemberError: - pass + d['user_password'] = user.password + d['user_language'] = member.preferred_language + d['user_name'] = (user.real_name if user.real_name + else member.address.original_address) + d['user_optionsurl'] = member.options_url # These strings are descriptive for the log file and shouldn't be i18n'd d.update(msgdata.get('decoration-data', {})) header = decorate(mlist, mlist.msg_header, d) diff --git a/mailman/pipeline/docs/file-recips.txt b/mailman/pipeline/docs/file-recips.txt index 03328f97e..e93bba9aa 100644 --- a/mailman/pipeline/docs/file-recips.txt +++ b/mailman/pipeline/docs/file-recips.txt @@ -40,7 +40,7 @@ members.txt. If the file doesn't exist, the list of recipients will be empty. >>> import os - >>> file_path = os.path.join(mlist.full_path, 'members.txt') + >>> file_path = os.path.join(mlist.data_path, 'members.txt') >>> open(file_path) Traceback (most recent call last): ... diff --git a/mailman/pipeline/file_recipients.py b/mailman/pipeline/file_recipients.py index 8d97500fe..44ced925d 100644 --- a/mailman/pipeline/file_recipients.py +++ b/mailman/pipeline/file_recipients.py @@ -46,7 +46,7 @@ class FileRecipients: """See `IHandler`.""" if 'recips' in msgdata: return - filename = os.path.join(mlist.full_path, 'members.txt') + filename = os.path.join(mlist.data_path, 'members.txt') try: with open(filename) as fp: addrs = set(line.strip() for line in fp) diff --git a/mailman/pipeline/smtp_direct.py b/mailman/pipeline/smtp_direct.py index d79510cb0..74eaa5aad 100644 --- a/mailman/pipeline/smtp_direct.py +++ b/mailman/pipeline/smtp_direct.py @@ -110,7 +110,7 @@ def process(mlist, msg, msgdata): envsender = msgdata.get('envsender') if envsender is None: if mlist: - envsender = mlist.GetBouncesEmail() + envsender = mlist.bounces_address else: envsender = Utils.get_site_noreply() # Time to split up the recipient list. If we're personalizing or VERPing @@ -183,7 +183,7 @@ def process(mlist, msg, msgdata): 'size' : len(msg.as_string()), '#recips' : len(recips), '#refused': len(refused), - 'listname': mlist.internal_name(), + 'listname': mlist.fqdn_listname, 'sender' : origsender, }) # We have to use the copy() method because extended call syntax requires a diff --git a/mailman/pipeline/to_digest.py b/mailman/pipeline/to_digest.py index 191e3a0f1..05b1dc3d5 100644 --- a/mailman/pipeline/to_digest.py +++ b/mailman/pipeline/to_digest.py @@ -74,7 +74,7 @@ def process(mlist, msg, msgdata): # Short circuit non-digestable lists. if not mlist.digestable or msgdata.get('isdigest'): return - mboxfile = os.path.join(mlist.full_path, 'digest.mbox') + mboxfile = os.path.join(mlist.data_path, 'digest.mbox') mboxfp = open(mboxfile, 'a+') mbox = Mailbox(mboxfp) mbox.AppendMessage(msg) |
