Add @img suffix to cid values

Turns out this is required to be spec-compliant. I don't think this was
why things broke in my tests, but it is good to be comlpiant.
This commit is contained in:
Magnus Hagander
2026-01-07 17:35:05 +01:00
parent ab9bb5f19b
commit fc120c1644
2 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@ def render_news_template(news):
'contenttype': '{}; name={}'.format(_get_contenttype_from_extension(f), f),
'filename': f,
'disposition': 'inline; filename="{}"'.format(f),
'id': '<{}>'.format(f),
'id': '<{}@img>'.format(f),
}
with open(os.path.join(basedir, f), "rb") as f:
a['content'] = f.read()

View File

@ -5,9 +5,9 @@
{%block content%}
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" style="width: 100%;">
<tr>
<td><img style="width: 50px; height: 50px;" height="50" width="50" src="cid:slonik.png" alt="PostgreSQL logo"></td>
<td><img style="width: 50px; height: 50px;" height="50" width="50" src="cid:slonik.png@img" alt="PostgreSQL logo"></td>
<td style="text-align: center;"><h1>{{news.title}}</h1></td>
<td><img style="width: 50px; height: 50px;" height="50" width="50" src="cid:slonik.png" alt="PostgreSQL logo"></td>
<td><img style="width: 50px; height: 50px;" height="50" width="50" src="cid:slonik.png@img" alt="PostgreSQL logo"></td>
</tr>
</table>
{{news.content|markdown}}