jpoehls/gophermail — pull request #7 by nelsam (2014-04-10 04:05:46+00:00)
Title: Add support for Content-ID attachments, for using attachments in html email

I'm not sure if this is something you want to support, but we needed, so I wrote it.

We were trying to embed images in our html messages through Amazon SES using gophermail, when we found out that Amazon SES doesn't support embedded images. However, it does support using Content-ID in attachments, which allows for using the attachments within the email for things like tags.

This patch adds a ContentID field to the Attachment struct, which is used in Message.Bytes as an attachment's "Content-ID" header, if the value is non-empty.

The Content-ID header requires the value to be enclosed in angle brackets, and it appears to work best when the value is something like "", but this patch doesn't enforce any of that structure. I just needed rudimentary support for my testing. If you'd like it to enforce some/all of that structure, I can of course add it in.