This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Eric Lafontaine
Recipients Eric Lafontaine, Henning.von.Bargen, r.david.murray
Date 2016-12-06.17:34:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1481045696.92.0.677556121984.issue28879@psf.upfronthosting.co.za>
In-reply-to
Content
Hi,  Not sure this is where the comment goes...

I work with the smtplib and email libraries.  I understand Henning von Bargen when he say that we should have a way to support RFC 5322 without asking the user to understand how to support it.  The issue is that the SMTP protocol is NOT the protocol that format the e-mail.  SMTP is the protocol that identify the "from", the "to", start encryption and finally transfert the message.  The actual e-mail content is all passed inside the SMTP "DATA" Command.  I strongly believe that an email should not be modified by a SMTP library.

the discussion should be focused on trying to make it available to the user WITHOUT changing the current behavior of email.message class.  


In other words, I disagree to change the SMTPlib module and suggest that it's how you construct your email in the first place that should consider it;
class MessageRfc5322(email.message.Message):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        if self.get('Date', None) is None:
            self.add_header('Date', email.utils.formatdate())

msg = email.message_from_string(string_message, MessageRfc5322)



But, that's my opinion as someone who uses the smtplib and email library but also need to support rfc822 clients...
History
Date User Action Args
2016-12-06 17:34:56Eric Lafontainesetrecipients: + Eric Lafontaine, r.david.murray, Henning.von.Bargen
2016-12-06 17:34:56Eric Lafontainesetmessageid: <1481045696.92.0.677556121984.issue28879@psf.upfronthosting.co.za>
2016-12-06 17:34:56Eric Lafontainelinkissue28879 messages
2016-12-06 17:34:56Eric Lafontainecreate