diff --git a/Doc/library/smtpd.rst b/Doc/library/smtpd.rst --- a/Doc/library/smtpd.rst +++ b/Doc/library/smtpd.rst @@ -2,7 +2,7 @@ ============================ .. module:: smtpd - :synopsis: A SMTP server implementation in Python. + :synopsis: An SMTP server implementation in Python. .. moduleauthor:: Barry Warsaw .. sectionauthor:: Moshe Zadka @@ -49,7 +49,8 @@ attribute. *peer* is the remote host's address, *mailfrom* is the envelope originator, *rcpttos* are the envelope recipients and *data* is a string containing the contents of the e-mail (which should be in :rfc:`2822` - format). + format). *mailfrom*, *rcpttos* and *data* have been decoded as + latin1. .. attribute:: channel_class @@ -130,7 +131,7 @@ .. attribute:: received_lines - Holds a list of the line strings (decoded using UTF-8) received from + Holds a list of the line strings (decoded using latin1) received from the client. The lines have their ``"\r\n"`` line ending translated to ``"\n"``. diff --git a/Lib/smtpd.py b/Lib/smtpd.py --- a/Lib/smtpd.py +++ b/Lib/smtpd.py @@ -287,7 +287,7 @@ return elif limit: self.num_bytes += len(data) - self.received_lines.append(str(data, "utf-8")) + self.received_lines.append(str(data, "latin1")) # Implementation of base class abstract method def found_terminator(self):