What are the valid characters for a Mime Multipart message ContentId “CID:”?

丶灬走出姿态 提交于 2019-12-23 19:15:31

问题


From reading the RFC it appears that CID can/must only contain characters from the same set as those permissable by a regular URI. Is this correct. Im asking because I wish to writeup a simple helper that takes a CIDs prefix and adds a counter when generating CID for mime multitypes attachments.


回答1:


The Content-ID value is required to be in the form of an RFC-822 addr-spec (user@domain).

Since an addr-spec may contain characters not allowed in a URL, those characters are hex-encoded when used in the "cid" URL.

Per RFC2392:

A "cid" URL is converted to the corresponding Content-ID message header [MIME] by
removing the "cid:" prefix, converting the % encoded character to their equivalent US-ASCII characters, and enclosing the remaining parts with an angle bracket pair, "<" and ">".

Read more: http://www.faqs.org/rfcs/rfc2392.html



来源:https://stackoverflow.com/questions/2605012/what-are-the-valid-characters-for-a-mime-multipart-message-contentid-cid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!