~sumanah/mailman/mailman

« back to all changes in this revision

Viewing changes to src/mailman/email/message.py

  • Committer: Sumana Harihareswara
  • Date: 2015-01-08 21:35:58 UTC
  • mfrom: (7273.2.15 3.0)
  • Revision ID: sumanah@panix.com-20150108213558-65ym6553zj256z8p
mergeĀ fromĀ master

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 1998-2014 by the Free Software Foundation, Inc.
 
1
# Copyright (C) 1998-2015 by the Free Software Foundation, Inc.
2
2
#
3
3
# This file is part of GNU Mailman.
4
4
#
23
23
attributes.
24
24
"""
25
25
 
26
 
from __future__ import absolute_import, print_function, unicode_literals
27
 
 
28
 
__metaclass__ = type
29
26
__all__ = [
30
27
    'Message',
31
28
    'MultipartDigestMessage',
40
37
 
41
38
from email.header import Header
42
39
from email.mime.multipart import MIMEMultipart
43
 
 
44
40
from mailman.config import config
45
41
 
46
42
 
149
145
        subject = ('(no subject)' if subject is None else subject)
150
146
        if text is not None:
151
147
            self.set_payload(text.encode(charset), charset)
152
 
        self['Subject'] = Header(subject.encode(charset), charset,
153
 
                                 header_name='Subject', errors='replace')
 
148
        self['Subject'] = Header(
 
149
            subject, charset, header_name='Subject', errors='replace')
154
150
        self['From'] = sender
155
151
        if isinstance(recipients, (list, set, tuple)):
156
152
            self['To'] = COMMASPACE.join(recipients)
198
194
            reduced_list_headers=True,
199
195
            )
200
196
        if mlist is not None:
201
 
            enqueue_kws['listname'] = mlist.fqdn_listname
 
197
            enqueue_kws['listid'] = mlist.list_id
202
198
        enqueue_kws.update(_kws)
203
199
        virginq.enqueue(self, **enqueue_kws)
204
200
 
227
223
        virginq = config.switchboards['virgin']
228
224
        # The message metadata better have a `recip' attribute
229
225
        virginq.enqueue(self,
230
 
                        listname=mlist.fqdn_listname,
 
226
                        listid=mlist.list_id,
231
227
                        recipients=self.recipients,
232
228
                        nodecorate=True,
233
229
                        reduced_list_headers=True,