~follybeachris/mailman/mailman2-stable-265848

« back to all changes in this revision

Viewing changes to Mailman/Handlers/CookHeaders.py

  • Committer: Mark Sapiro
  • Date: 2014-04-15 19:59:48 UTC
  • mfrom: (1374.1.8 dmarc-reject)
  • Revision ID: msapiro@value.net-20140415195948-ci8nny8rbv213lxj
Added and modified various options regarding DMARC.  See the NEWS file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    return Header(s, charset, maxlinelen, header_name, continuation_ws)
66
66
 
67
67
def change_header(name, value, mlist, msg, msgdata, delete=True, repl=True):
68
 
    if (mm_cfg.ALLOW_FROM_IS_LIST and
69
 
        mlist.from_is_list == 2 and
 
68
    if ((msgdata.get('from_is_list') == 2 or
 
69
        (msgdata.get('from_is_list') == 0 and mlist.from_is_list == 2)) and 
70
70
        not msgdata.get('_fasttrack')
71
71
       ):
72
72
        msgdata.setdefault('add_header', {})[name] = value
119
119
    change_header('Precedence', 'list',
120
120
                  mlist, msg, msgdata, repl=False)
121
121
    # Do we change the from so the list takes ownership of the email
122
 
    if mm_cfg.ALLOW_FROM_IS_LIST and mlist.from_is_list and not fasttrack:
 
122
    if (msgdata.get('from_is_list') or mlist.from_is_list) and not fasttrack:
123
123
        realname, email = parseaddr(msg['from'])
124
124
        if not realname:
125
125
            if mlist.isMember(email):
200
200
        # is already in From and Reply-To in this case and similarly for
201
201
        # a 'from is list' list.
202
202
        if mlist.personalize == 2 and mlist.reply_goes_to_list <> 1 \
203
 
           and not mlist.anonymous_list and not (mlist.from_is_list and
204
 
                                                 mm_cfg.ALLOW_FROM_IS_LIST):
 
203
           and not mlist.anonymous_list and not (mlist.from_is_list or
 
204
                                                 msgdata.get('from_is_list')):
205
205
            # Watch out for existing Cc headers, merge, and remove dups.  Note
206
206
            # that RFC 2822 says only zero or one Cc header is allowed.
207
207
            new = []