Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 124624
Collapse All | Expand All

(-)Mailman/Archiver/HyperArch.py (-3 / +8 lines)
Lines 569-584 Link Here
569
        if d['_message_id']:
569
        if d['_message_id']:
570
            headers.append('Message-ID: %(_message_id)s')
570
            headers.append('Message-ID: %(_message_id)s')
571
        body = EMPTYSTRING.join(self.body)
571
        body = EMPTYSTRING.join(self.body)
572
        if isinstance(body, types.UnicodeType):
572
        cset = Utils.GetCharSet(self._lang)
573
            body = body.encode(Utils.GetCharSet(self._lang), 'replace')
573
        # Coerce the body to Unicode and replace any invalid characters.
574
        if not isinstance(body, types.UnicodeType):
575
            body = unicode(body, cset, 'replace')
574
        if mm_cfg.ARCHIVER_OBSCURES_EMAILADDRS:
576
        if mm_cfg.ARCHIVER_OBSCURES_EMAILADDRS:
575
            otrans = i18n.get_translation()
577
            otrans = i18n.get_translation()
576
            try:
578
            try:
579
                atmark = unicode(_(' at '), cset)
577
                i18n.set_language(self._lang)
580
                i18n.set_language(self._lang)
578
                body = re.sub(r'([-+,.\w]+)@([-+.\w]+)',
581
                body = re.sub(r'([-+,.\w]+)@([-+.\w]+)',
579
                              '\g<1>' + _(' at ') + '\g<2>', body)
582
                              '\g<1>' + atmark + '\g<2>', body)
580
            finally:
583
            finally:
581
                i18n.set_translation(otrans)
584
                i18n.set_translation(otrans)
585
        # Return body to character set of article.
586
        body = body.encode(cset, 'replace')
582
        return NL.join(headers) % d + '\n\n' + body + '\n'
587
        return NL.join(headers) % d + '\n\n' + body + '\n'
583
588
584
    def _set_date(self, message):
589
    def _set_date(self, message):
(-)Mailman/Bouncers/SimpleMatch.py (-2 / +7 lines)
Lines 1-4 Link Here
1
# Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
1
# Copyright (C) 1998-2006 by the Free Software Foundation, Inc.
2
#
2
#
3
# This program is free software; you can redistribute it and/or
3
# This program is free software; you can redistribute it and/or
4
# modify it under the terms of the GNU General Public License
4
# modify it under the terms of the GNU General Public License
Lines 12-18 Link Here
12
#
12
#
13
# You should have received a copy of the GNU General Public License
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
16
# USA.
16
17
17
"""Recognizes simple heuristically delimited bounces."""
18
"""Recognizes simple heuristically delimited bounces."""
18
19
Lines 74-79 Link Here
74
    (_c('This message was created automatically by mail delivery'),
75
    (_c('This message was created automatically by mail delivery'),
75
     _c('^---- START OF RETURNED MESSAGE ----'),
76
     _c('^---- START OF RETURNED MESSAGE ----'),
76
     _c("addressed to '(?P<addr>[^']*)'")),
77
     _c("addressed to '(?P<addr>[^']*)'")),
78
    # Prodigy.net full mailbox
79
    (_c("User's mailbox is full:"),
80
     _c('Unable to deliver mail.'),
81
     _c("User's mailbox is full:\s*<(?P<addr>.*)>.*$")),
77
    # Next one goes here...
82
    # Next one goes here...
78
    ]
83
    ]
79
84
(-)Mailman/Cgi/edithtml.py (-1 / +2 lines)
Lines 1-4 Link Here
1
# Copyright (C) 1998-2005 by the Free Software Foundation, Inc.
1
# Copyright (C) 1998-2006 by the Free Software Foundation, Inc.
2
#
2
#
3
# This program is free software; you can redistribute it and/or
3
# This program is free software; you can redistribute it and/or
4
# modify it under the terms of the GNU General Public License
4
# modify it under the terms of the GNU General Public License
Lines 20-25 Link Here
20
import os
20
import os
21
import cgi
21
import cgi
22
import errno
22
import errno
23
import re
23
24
24
from Mailman import Utils
25
from Mailman import Utils
25
from Mailman import MailList
26
from Mailman import MailList
(-)Mailman/Gui/Topics.py (+3 lines)
Lines 91-96 Link Here
91
            ]
91
            ]
92
92
93
    def handleForm(self, mlist, category, subcat, cgidata, doc):
93
    def handleForm(self, mlist, category, subcat, cgidata, doc):
94
        # MAS: Did we come from the authentication page?
95
        if not cgidata.has_key('topic_box_01'):
96
            return
94
        topics = []
97
        topics = []
95
        # We start i at 1 and keep going until we no longer find items keyed
98
        # We start i at 1 and keep going until we no longer find items keyed
96
        # with the marked tags.
99
        # with the marked tags.
(-)Mailman/Handlers/CookHeaders.py (-4 / +3 lines)
Lines 193-202 Link Here
193
    # We always add a List-ID: header.
193
    # We always add a List-ID: header.
194
    del msg['list-id']
194
    del msg['list-id']
195
    msg['List-Id'] = listid_h
195
    msg['List-Id'] = listid_h
196
    # For internally crafted messages, we
196
    # For internally crafted messages, we also add a (nonstandard),
197
    # also add a (nonstandard), "X-List-Administrivia: yes" header.  For all
197
    # "X-List-Administrivia: yes" header.  For all others (i.e. those coming
198
    # others (i.e. those coming from list posts), we adda a bunch of other RFC
198
    # from list posts), we add a bunch of other RFC 2369 headers.
199
    # 2369 headers.
200
    requestaddr = mlist.GetRequestEmail()
199
    requestaddr = mlist.GetRequestEmail()
201
    subfieldfmt = '<%s>, <mailto:%s?subject=%ssubscribe>'
200
    subfieldfmt = '<%s>, <mailto:%s?subject=%ssubscribe>'
202
    listinfo = mlist.GetScriptURL('listinfo', absolute=1)
201
    listinfo = mlist.GetScriptURL('listinfo', absolute=1)
(-)Mailman/Handlers/SpamDetect.py (-13 / +15 lines)
Lines 1-4 Link Here
1
# Copyright (C) 1998-2005 by the Free Software Foundation, Inc.
1
# Copyright (C) 1998-2006 by the Free Software Foundation, Inc.
2
#
2
#
3
# This program is free software; you can redistribute it and/or
3
# This program is free software; you can redistribute it and/or
4
# modify it under the terms of the GNU General Public License
4
# modify it under the terms of the GNU General Public License
Lines 92-99 Link Here
92
92
93
93
94
def process(mlist, msg, msgdata):
94
def process(mlist, msg, msgdata):
95
    if msgdata.get('approved') or msgdata.get('reduced_list_headers'):
95
    if msgdata.get('approved'):
96
        # TK: 'reduced_list_headers' is intenally crafted message (virgin).
97
        return
96
        return
98
    # First do site hard coded header spam checks
97
    # First do site hard coded header spam checks
99
    for header, regex in mm_cfg.KNOWN_SPAMMERS:
98
    for header, regex in mm_cfg.KNOWN_SPAMMERS:
Lines 103-122 Link Here
103
            if mo:
102
            if mo:
104
                # we've detected spam, so throw the message away
103
                # we've detected spam, so throw the message away
105
                raise SpamDetected
104
                raise SpamDetected
105
    # Before we go to header_filter_rules, we exclude internally generated
106
    # owner notification from checking, because 1) we collect headers from
107
    # all the attachments but this will cause matching the filter rule again,
108
    # and 2) list owners may want to check header name / value pair like
109
    # 'Precedence: bulk' which is also generated by mailman.  Both will
110
    # cause loop of holding owner notification messages if the action is
111
    # set to 'hold'.
112
    if msgdata.get('toowner') and msg.get('x-list-administrivia') == 'yes':
113
        return
106
    # Now do header_filter_rules
114
    # Now do header_filter_rules
107
    # TK: Collect headers in sub-parts because attachment filename
115
    # TK: Collect headers in sub-parts because attachment filename
108
    # extension may be a clue to possible virus/spam.
116
    # extension may be a clue to possible virus/spam.
109
    if msg.is_multipart():
117
    headers = ''
110
        headers = ''
118
    for p in msg.walk():
111
        for p in msg.walk():
112
            g = HeaderGenerator(StringIO())
113
            g.flatten(p)
114
            headers += g.header_text()
115
    else:
116
        # Only the top level header should be checked.
117
        g = HeaderGenerator(StringIO())
119
        g = HeaderGenerator(StringIO())
118
        g.flatten(msg)
120
        g.flatten(p)
119
        headers = g.header_text()
121
        headers += g.header_text()
120
    # Now reshape headers (remove extra CR and connect multiline).
122
    # Now reshape headers (remove extra CR and connect multiline).
121
    headers = re.sub('\n+', '\n', headers)
123
    headers = re.sub('\n+', '\n', headers)
122
    headers = re.sub('\n\s', ' ', headers)
124
    headers = re.sub('\n\s', ' ', headers)

Return to bug 124624