Short Version
A Content-ID header on an attachment must be of the form local-part "@" domain
. Gmail's Content-IDs do not have an @
in them. Is this a real bug, or am I misreading the spec?
Long Version
I noticed this problem when I tried to resend an email sent from Gmail that has an inline image attached. My mailer (SwiftMailer) claimed that the Content-ID was invalid.
Here's the email I'm working with. I created this by inserting an image inline in Gmail and emailing it to myself.
Here are the relevant parts of the spec (as far as I can tell):
Content-ID Header Field
In constructing a high-level user agent, it may be desirable to allow
one body to make reference to another. Accordingly, bodies may be
labelled using the "Content-ID" header field, which is syntactically
identical to the "Message-ID" header field:
id := "Content-ID" ":" msg-id
msg-id = "<" addr-spec ">" ; Unique message id
addr-spec = local-part "@" domain ; global address
What am I missing here? Is Gmail not following the spec, or is it ok not to have an @
in the Content-ID?
mail
is having trouble parsing these Content-IDs correctly. – Elora