diff options
author | Mark Sapiro <mark@msapiro.net> | 2008-11-30 20:30:43 -0800 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2008-11-30 20:30:43 -0800 |
commit | f579d5c290b80e00974e8c034f9d6dd697fcdfa6 (patch) | |
tree | 7ad0054577c7e457a94ecec5cd55d0003c2c2f08 /Mailman/Bouncers | |
parent | 0e6f7c1fc99eb7e35c23695bca2c17e757baf514 (diff) | |
download | mailman2-f579d5c290b80e00974e8c034f9d6dd697fcdfa6.tar.gz mailman2-f579d5c290b80e00974e8c034f9d6dd697fcdfa6.tar.xz mailman2-f579d5c290b80e00974e8c034f9d6dd697fcdfa6.zip |
Now that Python 2.4 is the minimum and we will use more recent installed
email packages, convert all the email message get_type() calls to
get_content_type().
Diffstat (limited to 'Mailman/Bouncers')
-rw-r--r-- | Mailman/Bouncers/Caiwireless.py | 4 | ||||
-rw-r--r-- | Mailman/Bouncers/GroupWise.py | 4 | ||||
-rw-r--r-- | Mailman/Bouncers/Microsoft.py | 4 | ||||
-rw-r--r-- | Mailman/Bouncers/Netscape.py | 4 | ||||
-rw-r--r-- | Mailman/Bouncers/Postfix.py | 6 |
5 files changed, 11 insertions, 11 deletions
diff --git a/Mailman/Bouncers/Caiwireless.py b/Mailman/Bouncers/Caiwireless.py index e2909122..b71b0624 100644 --- a/Mailman/Bouncers/Caiwireless.py +++ b/Mailman/Bouncers/Caiwireless.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2008 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -27,7 +27,7 @@ acre = re.compile(r'<(?P<addr>[^>]*)>') def process(msg): - if msg.get_type() <> 'multipart/mixed': + if msg.get_content_type() <> 'multipart/mixed': return None # simple state machine # 0 == nothing seen diff --git a/Mailman/Bouncers/GroupWise.py b/Mailman/Bouncers/GroupWise.py index 74116135..e5122f73 100644 --- a/Mailman/Bouncers/GroupWise.py +++ b/Mailman/Bouncers/GroupWise.py @@ -30,7 +30,7 @@ acre = re.compile(r'<(?P<addr>[^>]*)>') def find_textplain(msg): - if msg.get_type(msg.get_default_type()) == 'text/plain': + if msg.get_content_type() == 'text/plain': return msg if msg.is_multipart: for part in msg.get_payload(): @@ -44,7 +44,7 @@ def find_textplain(msg): def process(msg): - if msg.get_type() <> 'multipart/mixed' or not msg['x-mailer']: + if msg.get_content_type() <> 'multipart/mixed' or not msg['x-mailer']: return None if msg['x-mailer'][:3].lower() not in ('nov', 'ntm', 'int'): return None diff --git a/Mailman/Bouncers/Microsoft.py b/Mailman/Bouncers/Microsoft.py index d8a90b24..fec7cc93 100644 --- a/Mailman/Bouncers/Microsoft.py +++ b/Mailman/Bouncers/Microsoft.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2003 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2008 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -25,7 +25,7 @@ scre = re.compile(r'transcript of session follows', re.IGNORECASE) def process(msg): - if msg.get_type() <> 'multipart/mixed': + if msg.get_content_type() <> 'multipart/mixed': return None # Find the first subpart, which has no MIME type try: diff --git a/Mailman/Bouncers/Netscape.py b/Mailman/Bouncers/Netscape.py index f5974602..8c21f629 100644 --- a/Mailman/Bouncers/Netscape.py +++ b/Mailman/Bouncers/Netscape.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2008 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -61,7 +61,7 @@ def process(msg): leaves = [] flatten(msg, leaves) for i, subpart in zip(range(len(leaves)-1), leaves): - if subpart.get_type() == 'text/plain': + if subpart.get_content_type() == 'text/plain': plainmsg = subpart break if not plainmsg: diff --git a/Mailman/Bouncers/Postfix.py b/Mailman/Bouncers/Postfix.py index 1fab8666..3c250e95 100644 --- a/Mailman/Bouncers/Postfix.py +++ b/Mailman/Bouncers/Postfix.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2003 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2008 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -71,14 +71,14 @@ def findaddr(msg): def process(msg): - if msg.get_type() not in ('multipart/mixed', 'multipart/report'): + if msg.get_content_type() not in ('multipart/mixed', 'multipart/report'): return None # We're looking for the plain/text subpart with a Content-Description: of # `notification'. leaves = [] flatten(msg, leaves) for subpart in leaves: - if subpart.get_type() == 'text/plain' and \ + if subpart.get_content_type() == 'text/plain' and \ subpart.get('content-description', '').lower() == 'notification': # then... return findaddr(subpart) |