~tgc/mailman/2.1-da

« back to all changes in this revision

Viewing changes to Mailman/Handlers/Cleanse.py

  • Committer: Mark Sapiro
  • Date: 2013-09-27 23:33:35 UTC
  • Revision ID: mark@msapiro.net-20130927233335-o2pmv0e5k0f77sb8
Made author_is_list a 3-way with an option to wrap the message.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    del msg['x-approve']
40
40
    # Also remove this header since it can contain a password
41
41
    del msg['urgent']
42
 
    # Do we change the from so the list takes ownership of the email
43
 
    # This really belongs in CookHeaders.
44
 
    if mm_cfg.ALLOW_AUTHOR_IS_LIST and mlist.author_is_list:
45
 
        realname, email = parseaddr(msg['from'])
46
 
        replies = getaddresses(msg.get('reply-to', ''))
47
 
        reply_addrs = [x[1].lower() for x in replies]
48
 
        if reply_addrs:
49
 
            if email.lower() not in reply_addrs:
50
 
                rt = msg['reply-to'] + ', ' + msg['from']
51
 
            else:
52
 
                rt = msg['reply-to']
53
 
        else:
54
 
            rt = msg['from']
55
 
        del msg['reply-to']
56
 
        msg['Reply-To'] = rt
57
 
        del msg['from']
58
 
        msg['From'] = formataddr(('%s via %s' % (realname, mlist.real_name),
59
 
                                 mlist.GetListEmail()))
60
 
        del msg['sender']
61
 
        #MAS mlist.include_sender_header = 0
62
42
    # We remove other headers from anonymous lists
63
43
    if mlist.anonymous_list:
64
44
        syslog('post', 'post to %s from %s anonymized',