Re: [Django] #35378: Incorrect folding of long address headers with special characters when using 7bit Content-Transfer-Encoding in EmailMessage

2024-07-02 Thread Django
#35378: Incorrect folding of long address headers with special characters when
using 7bit Content-Transfer-Encoding in EmailMessage
-+
 Reporter:  andres   |Owner:  (none)
 Type:  Bug  |   Status:  closed
Component:  Core (Mail)  |  Version:  dev
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  email, compat32  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+
Comment (by Mike Edmunds):

 (Reported Python email bug as
 [https://github.com/python/cpython/issues/121284 python/cpython#121284 ])
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107019074a1a2e3-bd98a337-79f0-49ba-ae24-a502ba7d1e2e-00%40eu-central-1.amazonses.com.


Re: [Django] #35378: Incorrect folding of long address headers with special characters when using 7bit Content-Transfer-Encoding in EmailMessage

2024-06-28 Thread Django
#35378: Incorrect folding of long address headers with special characters when
using 7bit Content-Transfer-Encoding in EmailMessage
-+
 Reporter:  andres   |Owner:  (none)
 Type:  Bug  |   Status:  closed
Component:  Core (Mail)  |  Version:  dev
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  email, compat32  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+
Changes (by Sarah Boyce):

 * resolution:   => invalid
 * status:  new => closed

Comment:

 Thank you for the update Mike, updated the ticket accordingly
 Also following the discussion of https://groups.google.com/u/2/g/django-
 developers/c/2zf9GQtjdIk which is nice to see 👍
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701905e4d8373-7644749b-39d8-46e2-99a4-569a574d4067-00%40eu-central-1.amazonses.com.


Re: [Django] #35378: Incorrect folding of long address headers with special characters when using 7bit Content-Transfer-Encoding in EmailMessage

2024-06-23 Thread Django
#35378: Incorrect folding of long address headers with special characters when
using 7bit Content-Transfer-Encoding in EmailMessage
-+
 Reporter:  andres   |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Core (Mail)  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  email, compat32  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+
Changes (by Mike Edmunds):

 * keywords:   => email, compat32

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107019046646641-d60fa9b3-e820-414d-a431-0d92701a33ab-00%40eu-central-1.amazonses.com.


Re: [Django] #35378: Incorrect folding of long address headers with special characters when using 7bit Content-Transfer-Encoding in EmailMessage

2024-06-23 Thread Django
#35378: Incorrect folding of long address headers with special characters when
using 7bit Content-Transfer-Encoding in EmailMessage
-+
 Reporter:  andres   |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Core (Mail)  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+
Changes (by Mike Edmunds):

 * cc: Mike Edmunds (added)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107019046479863-3c97954a-9f34-49d4-96af-1638fbdb0e37-00%40eu-central-1.amazonses.com.


Re: [Django] #35378: Incorrect folding of long address headers with special characters when using 7bit Content-Transfer-Encoding in EmailMessage

2024-06-22 Thread Django
#35378: Incorrect folding of long address headers with special characters when
using 7bit Content-Transfer-Encoding in EmailMessage
-+
 Reporter:  andres   |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Core (Mail)  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+
Comment (by Mike Edmunds):

 [I'm responsible for the example cited above. Setting an existing
 message's `policy` attribute like that isn't documented anywhere, so
 probably shouldn't be considered a valid test case. Apologies for that.]

 I've come to the conclusion that any attempt to use modern
 email.policy.default to serialize an email.message.Message (which is
 constructed with legacy email.policy.compat32) is prone to errors, and
 probably just isn't supported by the Python email package. Additional
 information in https://github.com/anymail/django-
 anymail/issues/369#issuecomment-2184252097

 I would suggest ''not'' trying to fix this particular issue within Django.
 Long term, there would be a lot of advantages to upgrading
 django.core.mail to use modern email.message.EmailMessage (and
 email.policy.default). But that's a separate issue, and I think needs to
 happen all at once; trying to mix legacy and modern email code seems
 problematic.

 Here's an updated test, using only documented Python email package
 features (generator policy override). It has the same problem, but I think
 clarifies this is more of a Python email bug than a Django problem:

 {{{#!python
 import email.generator
 import email.policy
 import io
 import django.core.mail

 to = '"Người nhận a very very long, name" '
 mime_message = django.core.mail.EmailMessage(to=[to]).message()

 fp = io.BytesIO()
 g = email.generator.BytesGenerator(
 fp,
 policy=email.policy.default.clone(cte_type="7bit"),
 )
 g.flatten(mime_message)
 print(fp.getvalue().decode("ascii"))
 # [... other headers ...]
 # To: =?utf-8?b?TmfGsOG7nWkgbmjhuq1u?= a very very long, name
 
 }}}
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107019042822890-135be665-7d99-4a35-9799-2af499672ff7-00%40eu-central-1.amazonses.com.


Re: [Django] #35378: Incorrect folding of long address headers with special characters when using 7bit Content-Transfer-Encoding in EmailMessage

2024-05-15 Thread Django
#35378: Incorrect folding of long address headers with special characters when
using 7bit Content-Transfer-Encoding in EmailMessage
-+
 Reporter:  andres   |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Core (Mail)  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+
Changes (by Lufafa Joshua):

 * owner:  Lufafa Joshua => (none)
 * status:  assigned => new

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f7d812a6c-2e3e7a20-6c81-428a-956d-cb5f6123d405-00%40eu-central-1.amazonses.com.


Re: [Django] #35378: Incorrect folding of long address headers with special characters when using 7bit Content-Transfer-Encoding in EmailMessage

2024-05-10 Thread Django
#35378: Incorrect folding of long address headers with special characters when
using 7bit Content-Transfer-Encoding in EmailMessage
-+-
 Reporter:  andres   |Owner:  Lufafa Joshua
 Type:  Bug  |   Status:  assigned
Component:  Core (Mail)  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Lufafa Joshua):

 * has_patch:  1 => 0

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f62b689f7-26aa9994-2c45-4d18-b7ca-c8d8bc9a08cd-00%40eu-central-1.amazonses.com.


Re: [Django] #35378: Incorrect folding of long address headers with special characters when using 7bit Content-Transfer-Encoding in EmailMessage

2024-04-30 Thread Django
#35378: Incorrect folding of long address headers with special characters when
using 7bit Content-Transfer-Encoding in EmailMessage
-+-
 Reporter:  andres   |Owner:  Lufafa Joshua
 Type:  Bug  |   Status:  assigned
Component:  Core (Mail)  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Sarah Boyce):

 * needs_better_patch:  0 => 1

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f2e42adc6-a3a9a4ce-4cf8-4ec1-8b99-f25e5d238c1d-00%40eu-central-1.amazonses.com.


Re: [Django] #35378: Incorrect folding of long address headers with special characters when using 7bit Content-Transfer-Encoding in EmailMessage

2024-04-28 Thread Django
#35378: Incorrect folding of long address headers with special characters when
using 7bit Content-Transfer-Encoding in EmailMessage
-+-
 Reporter:  andres   |Owner:  Lufafa Joshua
 Type:  Bug  |   Status:  assigned
Component:  Core (Mail)  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by andres):

 Thanks, Lufafa Joshua! I manually reproduced your fix here, did a quick
 test and it seems to work!
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f24a61ef3-56072c79-3dcb-4ff7-a62a-42604c389026-00%40eu-central-1.amazonses.com.


Re: [Django] #35378: Incorrect folding of long address headers with special characters when using 7bit Content-Transfer-Encoding in EmailMessage

2024-04-28 Thread Django
#35378: Incorrect folding of long address headers with special characters when
using 7bit Content-Transfer-Encoding in EmailMessage
-+-
 Reporter:  andres   |Owner:  Lufafa Joshua
 Type:  Bug  |   Status:  assigned
Component:  Core (Mail)  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Lufafa Joshua):

 * has_patch:  0 => 1

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f23937312-26d3e774-d453-41d0-9c34-4ab7c0aaa47f-00%40eu-central-1.amazonses.com.


Re: [Django] #35378: Incorrect folding of long address headers with special characters when using 7bit Content-Transfer-Encoding in EmailMessage

2024-04-23 Thread Django
#35378: Incorrect folding of long address headers with special characters when
using 7bit Content-Transfer-Encoding in EmailMessage
-+-
 Reporter:  andres   |Owner:  Lufafa Joshua
 Type:  Bug  |   Status:  assigned
Component:  Core (Mail)  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Lufafa Joshua):

 * owner:  nobody => Lufafa Joshua
 * status:  new => assigned

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f0a180d86-7a54333c-316f-4a0a-b304-083f01e5913f-00%40eu-central-1.amazonses.com.


Re: [Django] #35378: Incorrect folding of long address headers with special characters when using 7bit Content-Transfer-Encoding in EmailMessage (was: Bad UTF-8 "To" header encoding in EmailMessage)

2024-04-17 Thread Django
#35378: Incorrect folding of long address headers with special characters when
using 7bit Content-Transfer-Encoding in EmailMessage
-+
 Reporter:  andres   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Core (Mail)  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by Sarah Boyce):

 * cc: Florian Apolloner, Joachim Jablon (added)
 * stage:  Unreviewed => Accepted
 * summary:  Bad UTF-8 "To" header encoding in EmailMessage =>
 Incorrect folding of long address headers with special characters when
 using 7bit Content-Transfer-Encoding in EmailMessage
 * version:  5.0 => dev

Comment:

 Thank you for the report!
 I can replicate and the discussion in https://github.com/anymail/django-
 anymail/issues/369 is also very useful, thank you.

 > I'm pretty sure the problem only occurs with Python email's legacy
 `email.message.Message`, which uses a
 [https://docs.python.org/3/library/email.policy.html#email.policy.Compat32.fold
 different folding algorithm] (via `email.policy.compat32`) than modern
 `email.message.EmailMessage` (`email.policy.default`) uses.
 > My understanding is the Compat32 legacy layer is there specifically to
 replicate Python 2's email behavior (including any bugs), so there's not
 much point in reporting bugs against it.

 Agree that #31784 is also somewhat related.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018eeb030ef1-36ea6f7b-d74b-4cf9-8305-f07230c0b919-00%40eu-central-1.amazonses.com.