From aa441ecb4472f991912fa9e0fbeff2e1a3aa8bb6 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Mon, 1 Oct 2001 16:29:05 +0000 Subject: Convert from mimelib to email. Also, use cStringIO directly instead of our own hack-around StringIO module. --- Mailman/Bouncers/Postfix.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Mailman/Bouncers/Postfix.py') diff --git a/Mailman/Bouncers/Postfix.py b/Mailman/Bouncers/Postfix.py index 86fb7be91..f55147a0a 100644 --- a/Mailman/Bouncers/Postfix.py +++ b/Mailman/Bouncers/Postfix.py @@ -27,13 +27,13 @@ It also matches something claiming to be `The BNS Postfix program'. import re -from Mailman.pythonlib.StringIO import StringIO +from cStringIO import StringIO def flatten(msg, leaves): # give us all the leaf (non-multipart) subparts - if msg.ismultipart(): + if msg.is_multipart(): for part in msg.get_payload(): flatten(part, leaves) else: @@ -72,14 +72,14 @@ def findaddr(msg): def process(msg): - if msg.gettype() <> 'multipart/mixed': + if msg.get_type() <> 'multipart/mixed': 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.gettype() == 'text/plain' and \ + if subpart.get_type() == 'text/plain' and \ subpart.get('content-description', '').lower() == 'notification': # then... return findaddr(subpart) -- cgit v1.2.3-70-g09d2