-
Notifications
You must be signed in to change notification settings - Fork 4
Description
The inline image example from the README
(let [content-id (mime-id/get-random)] (tarayo/send! conn { ... {:content (io/file "test/resources/image.png") :id content-id}]})))
does not work:
(mime-id/get-random) generates an ID with angle brackets (e.g. <v1ftPA1387YargzL.1649756854160@tarayo.myhost.com>),
but when generating the message, the content ID is again put into angle brackets here:
https://github.com/toyokumo/tarayo/blame/master/src/tarayo/mail/mime/multipart/body.clj#L88=
This results in the following invalid HTML img tag and the img not being displayed (at least in Thunderbird):
`------=_Part_2_1478985609.1649756558122
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
world
------=_Part_2_1478985609.1649756558122
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=logo.png
Content-ID: <4qvfSIfPJ62aOa6t.1649756558112@tarayo.myhost.com>`
Also the content id now contains double angle brackets.
To fix this issue, either the ID should not be out into angle brackets or the Content-ID is inserted without putting it into angle brackets. I would prefer the first option to keep backwards compatibilty and also not to have the implicit assumption, that all supplied content ids will be put into angle brackets.