1.1 --- a/imiptools/__init__.py Thu Aug 20 22:45:00 2015 +0200
1.2 +++ b/imiptools/__init__.py Thu Aug 20 23:52:18 2015 +0200
1.3 @@ -227,12 +227,18 @@
1.4 for name, cls in self.handlers])
1.5 handled = False
1.6
1.7 + # Check for returned messages.
1.8 +
1.9 for part in msg.walk():
1.10 - if part.get_content_type() in itip_content_types and \
1.11 - part.get_param("method"):
1.12 + if part.get_content_type() == "message/delivery-status":
1.13 + break
1.14 + else:
1.15 + for part in msg.walk():
1.16 + if part.get_content_type() in itip_content_types and \
1.17 + part.get_param("method"):
1.18
1.19 - handle_itip_part(part, handlers)
1.20 - handled = True
1.21 + handle_itip_part(part, handlers)
1.22 + handled = True
1.23
1.24 # When processing outgoing messages, no replies or deliveries are
1.25 # performed.