summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortkikuchi2006-03-07 12:43:13 +0000
committertkikuchi2006-03-07 12:43:13 +0000
commitb012e026bd55fd6c2d629789fb6f4c5893142f2b (patch)
tree89d34464c589f766eeee4b3a7d3b322cb9fb98ef
parent2dfa8367df0c34d3c4ba779d0911e8f50d631bce (diff)
downloadmailman-b012e026bd55fd6c2d629789fb6f4c5893142f2b.tar.gz
mailman-b012e026bd55fd6c2d629789fb6f4c5893142f2b.tar.zst
mailman-b012e026bd55fd6c2d629789fb6f4c5893142f2b.zip
-rw-r--r--Mailman/Bouncers/Caiwireless.py2
-rw-r--r--Mailman/Bouncers/DSN.py2
-rw-r--r--Mailman/Bouncers/GroupWise.py4
-rw-r--r--Mailman/Bouncers/Microsoft.py2
-rw-r--r--Mailman/Bouncers/Netscape.py2
-rw-r--r--Mailman/Bouncers/Postfix.py4
-rw-r--r--Mailman/Handlers/Decorate.py2
-rw-r--r--Mailman/Handlers/Scrubber.py4
-rw-r--r--Mailman/Handlers/Tagger.py7
9 files changed, 15 insertions, 14 deletions
diff --git a/Mailman/Bouncers/Caiwireless.py b/Mailman/Bouncers/Caiwireless.py
index e2909122c..b565f29be 100644
--- a/Mailman/Bouncers/Caiwireless.py
+++ b/Mailman/Bouncers/Caiwireless.py
@@ -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/DSN.py b/Mailman/Bouncers/DSN.py
index d78a1f4f6..8f7ae6456 100644
--- a/Mailman/Bouncers/DSN.py
+++ b/Mailman/Bouncers/DSN.py
@@ -85,6 +85,6 @@ def process(msg):
# The report-type parameter should be "delivery-status", but it seems that
# some DSN generating MTAs don't include this on the Content-Type: header,
# so let's relax the test a bit.
- if not msg.is_multipart() or msg.get_subtype() <> 'report':
+ if not msg.is_multipart() or msg.get_content_subtype() <> 'report':
return None
return check(msg)
diff --git a/Mailman/Bouncers/GroupWise.py b/Mailman/Bouncers/GroupWise.py
index 7ef312562..eb4075f1d 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
addrs = {}
# find the first text/plain part in the message
diff --git a/Mailman/Bouncers/Microsoft.py b/Mailman/Bouncers/Microsoft.py
index d8a90b248..f5adcf5ce 100644
--- a/Mailman/Bouncers/Microsoft.py
+++ b/Mailman/Bouncers/Microsoft.py
@@ -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 f59746024..b7f29e81b 100644
--- a/Mailman/Bouncers/Netscape.py
+++ b/Mailman/Bouncers/Netscape.py
@@ -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 1fab8666f..1d5e638f3 100644
--- a/Mailman/Bouncers/Postfix.py
+++ b/Mailman/Bouncers/Postfix.py
@@ -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)
diff --git a/Mailman/Handlers/Decorate.py b/Mailman/Handlers/Decorate.py
index 41db3950c..09b6d6c1d 100644
--- a/Mailman/Handlers/Decorate.py
+++ b/Mailman/Handlers/Decorate.py
@@ -121,7 +121,7 @@ def process(mlist, msg, msgdata):
wrap = False
except (LookupError, UnicodeError):
pass
- elif msg.get_type() == 'multipart/mixed':
+ elif msg.get_content_type() == 'multipart/mixed':
# The next easiest thing to do is just prepend the header and append
# the footer as additional subparts
payload = msg.get_payload()
diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py
index 4a4a3c59e..e15ae8beb 100644
--- a/Mailman/Handlers/Scrubber.py
+++ b/Mailman/Handlers/Scrubber.py
@@ -188,7 +188,7 @@ def process(mlist, msg, msgdata=None):
lcset_out = Charset(lcset).output_charset or lcset
# Now walk over all subparts of this message and scrub out various types
for part in msg.walk():
- ctype = part.get_type(part.get_default_type())
+ ctype = part.get_content_type()
# If the part is text/plain, we leave it alone
if ctype == 'text/plain':
# We need to choose a charset for the scrubbed message, so we'll
@@ -286,7 +286,7 @@ Url: %(url)s
# will transform the url into a hyperlink.
elif part and not part.is_multipart():
payload = part.get_payload(decode=True)
- ctype = part.get_type()
+ ctype = part.get_content_type()
# XXX Under email 2.5, it is possible that payload will be None.
# This can happen when you have a Content-Type: multipart/* with
# only one part and that part has two blank lines between the
diff --git a/Mailman/Handlers/Tagger.py b/Mailman/Handlers/Tagger.py
index 65ead7f6a..270f6611a 100644
--- a/Mailman/Handlers/Tagger.py
+++ b/Mailman/Handlers/Tagger.py
@@ -69,11 +69,12 @@ def scanbody(msg, numlines=None):
# or if the outer type is multipart/alternative and there is a text/plain
# part. Anything else, and the body is ignored for header-scan purposes.
found = None
- if msg.get_type('text/plain') == 'text/plain':
+ if msg.get_content_type() == 'text/plain':
found = msg
- elif msg.is_multipart() and msg.get_type() == 'multipart/alternative':
+ elif msg.is_multipart()\
+ and msg.get_content_type() == 'multipart/alternative':
for found in msg.get_payload():
- if found.get_type('text/plain') == 'text/plain':
+ if found.get_content_type() == 'text/plain':
break
else:
found = None