--- email/generator.py.orig 2011-01-13 12:20:26.000000000 -0500 +++ email/generator.py 2011-01-13 12:23:38.000000000 -0500 @@ -226,7 +226,8 @@ # Create a boundary that doesn't appear in any of the # message texts. alltext = self._encoded_NL.join(msgtexts) - msg.set_boundary(self._make_boundary(alltext)) + boundary = self._make_boundary(alltext) + msg.set_boundary(boundary) # If there's a preamble, write it out, with a trailing CRLF if msg.preamble is not None: self.write(msg.preamble + self._NL)