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.

classification
Title: Add AMP MIME type support
Type: enhancement Stage:
Components: email Versions:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Daniel Black, barry, r.david.murray
Priority: normal Keywords:

Created on 2019-03-28 05:03 by Daniel Black, last changed 2022-04-11 14:59 by admin.

Messages (7)
msg339014 - (view) Author: Daniel Black (Daniel Black) Date: 2019-03-28 05:03
AMP is being adopted by Gmail, Outlook, Mail.ru and Yahoo! as a valid MIME content-type message part. The Python email module could support this, I believe in an RFC-compliant way within the mimetypes module at mimetypes.types_map (and elsewhere as needed, possibly in the parser and generator though I suspect not as it's really utf-8 html other than the kinda silly lightning bolt emoji, which is optional to the AMP spec). My current concern is that the types map dictionary is keyed on filename extensions but AMP MIME (text/x-amp-html) is also .html. We can't have two keys for this and AMP doesn't have its own filename extension.
msg339031 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2019-03-28 12:41
Can you provide some links to relevant RFCs or other official documents?
msg339035 - (view) Author: Daniel Black (Daniel Black) Date: 2019-03-28 13:26
I'm not sure there's an RFC. I searched ietf but found none related to AMP
in MIME and AMP along search results were many (not accurate). I actually
doubt there's an RFC specific to AMP. What I meant is that AMP is itself
RFC compliant with RFC 2045-2050. As for official documentation here is the
link to the AMP project's description which gives some context:
https://amp.dev/documentation/guides-and-tutorials/integrate/add-email.html?format=email

Let me know if you need more information.

Dan Black
http://dan.black
917-873-3970

On Thu, Mar 28, 2019 at 8:41 AM R. David Murray <report@bugs.python.org>
wrote:

>
> R. David Murray <rdmurray@bitdance.com> added the comment:
>
> Can you provide some links to relevant RFCs or other official documents?
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue36460>
> _______________________________________
>
msg339050 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2019-03-28 14:55
That link should do for our purposes here.

The fact that it is an 'x-' mimetype means it has not been approved at
any level.  There might be an in progress application to the mimetype
registry, but if so the web site doesn't mention it anywhere obvious.

I'm not sure about the filetype problem, but I'm guessing amp isn't the
only mimetype that will have this issue going forward, so we probably need
to come up with a solution.  You don't need support from the mimetypes
module to create or manipulate emails using the content-type, though,
so it isn't a blocker on that side.

That lightning thing is *seriously* hokey :(
msg339064 - (view) Author: Daniel Black (Daniel Black) Date: 2019-03-28 17:39
I see! Okay... I'll consider a solution to the filetype portion of the
mimetypes map. Do you happen to know which other modules may depend on that
structure?

Yes... the lightning is silly.

Dan Black
http://dan.black
917-873-3970

On Thu, Mar 28, 2019 at 10:55 AM R. David Murray <report@bugs.python.org>
wrote:

>
> R. David Murray <rdmurray@bitdance.com> added the comment:
>
> That link should do for our purposes here.
>
> The fact that it is an 'x-' mimetype means it has not been approved at
> any level.  There might be an in progress application to the mimetype
> registry, but if so the web site doesn't mention it anywhere obvious.
>
> I'm not sure about the filetype problem, but I'm guessing amp isn't the
> only mimetype that will have this issue going forward, so we probably need
> to come up with a solution.  You don't need support from the mimetypes
> module to create or manipulate emails using the content-type, though,
> so it isn't a blocker on that side.
>
> That lightning thing is *seriously* hokey :(
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue36460>
> _______________________________________
>
msg339070 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2019-03-28 18:31
Not sure what you mean by "depend on that structure".  A quick grep
shows the only stdlib modules that use mimetimes are urllib and
http.server.

Backward compatibility will of course be a significant issue here.
msg339072 - (view) Author: Daniel Black (Daniel Black) Date: 2019-03-28 18:45
That's exactly what I meant: use, but in a way that cares how that data is
structured. Thanks for the pointer, I'll take a look.
History
Date User Action Args
2022-04-11 14:59:13adminsetgithub: 80641
2019-03-28 18:45:01Daniel Blacksetmessages: + msg339072
2019-03-28 18:31:30r.david.murraysetmessages: + msg339070
2019-03-28 17:39:40Daniel Blacksetmessages: + msg339064
2019-03-28 14:55:20r.david.murraysetmessages: + msg339050
2019-03-28 13:26:31Daniel Blacksetmessages: + msg339035
2019-03-28 12:41:06r.david.murraysetmessages: + msg339031
2019-03-28 05:03:15Daniel Blackcreate