The precise format of Content-Id header
<p>I'm really confused when it comes to the format of <code>Content-Id</code> headers in message parts.</p>
<p>It seems to me that only <a href="https://www.rfc-editor.org/rfc/rfc2045#section-7" rel="nofollow noreferrer">RFC 2045</a> covers the format of the header, however briefly:</p>
<blockquote>
<p>In constructing a high-level user agent, it may be desirable to allow
one body to make reference to another.  Accordingly, bodies may be<br />
labelled using the &quot;Content-ID&quot; header field, which is syntactically<br />
identical to the &quot;Message-ID&quot; header field:</p>
<pre><code> id := &quot;Content-ID&quot; &quot;:&quot; msg-id
</code></pre>
<p>Like the Message-ID values, Content-ID values must be generated to be
world-unique.</p>
</blockquote>
<p><a href="https://www.rfc-editor.org/rfc/rfc2822#section-3.6.4" rel="nofollow noreferrer">RFC 2822</a> explains the format of a <code>msg-id</code> token like so:</p>
<blockquote>
<p>The message identifier (msg-id) is similar in syntax to an angle-addr
construct without the internal CFWS.</p>
<p>message-id      =       &quot;Message-ID:&quot; msg-id CRLF</p>
<p>in-reply-to     =       &quot;In-Reply-To:&quot; 1*msg-id CRLF</p>
<p>references      =       &quot;References:&quot; 1*msg-id CRLF</p>
<p>msg-id          =       [CFWS] &quot;&lt;&quot; id-left &quot;@&quot; id-right &quot;&gt;&quot; [CFWS]</p>
<p>id-left         =       dot-atom-text / no-fold-quote / obs-id-left</p>
<p>id-right        =       dot-atom-text / no-fold-literal / obs-id-right</p>
<p>no-fold-quote   =       DQUOTE *(qtext / quoted-pair) DQUOTE</p>
<p>no-fold-literal =       &quot;[&quot; *(dtext / quoted-pair) &quot;]&quot;</p>
</blockquote>
<p>Long story short: it includes the at ('@') symbol, just like the <code>Message-Id</code> header of a message. However, almost all reader-friendly articles on MIME format give examples of <code>Content-Id</code> <strong>without</strong> the at symbol (including not-really-global identifiers like <code>myimagecid</code> or <code>inlineimage001</code> as well as randomly generated UUIDS without the at symbol). They would surely stress the importance of the '@' symbol if that would be necessary, just like they do with the <code>Message-Id</code> header, right? Right?</p>
<p>I've run some tests on real-world email clients and see how they compose emails with embedded inline images:</p>
<ul>
<li>Thunderbird generates identifiers with the at symbol. Example: <code>part1.12345678.12345678@domain.example.com</code></li>
<li>Gmail generates identifiers <em>without</em> such symbol and with no domain part. Example: <code>ii_abc1234x0_12345ab12abcdefa</code></li>
</ul>
<p>I didn't test any more email clients (if someone did, it'd be great to complete the list above), but these two already show the striking difference. Google not obeying RFC standards? It sure looks smelly and I want to know whether that's because I missed something, or because the format isn't really that important after all (which in the long run feels rather disturbing). I'm also interested in checking how many popular email clients actually discard the 'at' symbol.</p>