Index: roundup/mailer.py =================================================================== --- roundup/mailer.py (revision 4212) +++ roundup/mailer.py (working copy) @@ -141,24 +141,23 @@ elif error_messages_to == "both": to.append(dispatcher_email) - message = self.get_standard_message(to, subject) + message = self.get_standard_message(to, subject, multipart=True) # add the error text - part = MIMEText(error) + part = MIMEText('\n'.join(error)) message.attach(part) # attach the original message to the returned message + body = "" + for header in bounced_message.headers: + body += header try: bounced_message.rewindbody() - except IOError, message: - body.write("*** couldn't include message body: %s ***" - % bounced_message) + except IOError, errmessage: + body += "*** couldn't include message body: %s ***" % errmessage else: - body.write(bounced_message.fp.read()) - part = MIMEText(bounced_message.fp.read()) - part['Content-Disposition'] = 'attachment' - for header in bounced_message.headers: - part.write(header) + body += '\n' + bounced_message.fp.read() + part = MIMEText(body) message.attach(part) # send