Issue 791776: factor out SMTPHandler.emit date handling (original) (raw)

Change SMTPHandler.emit to use email.Utils.formatdate for date formatting. This changes the format from

Wdy, DD Mon YYYY HH:MM:SS GMT

to

Wdy, DD Mon YYYY HH:MM:SS (+/-)DDDD

which is the preferred format for email messages according to RFC 2822. This format is also accepted by the obsolete RFCs 822 and 1123, so there should be no compatibility problems.