PRs are now open:

   1. Updated test cases (on existing legacy implementation): 
   https://github.com/django/django/pull/18502
   2. Change to modern email API: https://github.com/medmunds/django/pull/2

A few changes of note from the original plan, based on things discovered 
during implementation:

   - I *did* end up deprecating MIMEBase attachments. Modern email has a 
   MIMEPart class that can be used in a similar fashion.
   - Modern email insists that text/* bodies and attachments should end 
   with a newline <https://github.com/python/cpython/issues/121515>, and 
   will add one for you if missing. I think that's probably OK, but it affects* 
   a lot of our tests* (which use strings like "Content" that don't include 
   trailing newlines). More details in PR#2 comments, and suggestions are 
   welcome if this seems like a problem.
   - These additional, *undocumented* django.core.mail features will be 
   retired without a deprecation period (but will raise errors on attempted 
   use, and have been identified in the release notes):
      - EmailMessage.mixed_subtype overrides: modern email uses 
      multipart/mixed
      - EmailMultiAlternatives.alternative_subtype overrides: modern email 
      uses multipart/alternative
      - Using a legacy email.charset.Charset object for the undocumented 
      EmailMessage.encoding: modern email doesn't support that. (But 
      EmailMessage.encoding will continue to support string charset names as it 
      has in the past, also still undocumented.)
   
Finally, although Python's modern email API is generally less buggy than 
the legacy API, it does have some issues of its own. (Including a security 
issue in address header generation that was publicly reported 5+ years ago, 
and that probably needs to be resolved before we'd want to merge the second 
PR.)

- Mike


On Saturday, July 6, 2024 at 12:18:22 PM UTC-7 Mike Edmunds wrote:

> Ticket created: https://code.djangoproject.com/ticket/35581
>
> On Friday, July 5, 2024 at 5:27:28 PM UTC-7 Mike Edmunds wrote:
>
>> Thanks to everyone for the feedback so far.
>>
>> It looks like all the responses to date are generally positive, and I 
>> haven't seen any objections, so I'm going to open a ticket.
>>
>> (Of course, additional feedback—positive or negative—and advice is very 
>> much appreciated.)
>>
>> Cheers,
>> Mike
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/9ecb3f48-ed85-44a8-863f-d165172cd81cn%40googlegroups.com.
        • ... Mike Edmunds
  • Re:... Mike Edmunds
    • ... Tom Carrick
      • ... Paolo Melchiorre
      • ... Mike Edmunds
    • ... Florian Apolloner
      • ... Ronny V.
        • ... Mike Edmunds
          • ... Jörg Breitbart
          • ... Mike Edmunds
            • ... Mike Edmunds
      • ... Mike Edmunds
        • ... Florian Apolloner
          • ... Mike Edmunds
        • ... Pankaj Kumar
          • ... Othniel Davidson
            • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
              • ... Mike Edmunds
    • ... Mike Edmunds

Reply via email to