Add @img suffix to cid values
authorMagnus Hagander <magnus@hagander.net>
Wed, 7 Jan 2026 16:35:05 +0000 (17:35 +0100)
committerMagnus Hagander <magnus@hagander.net>
Wed, 7 Jan 2026 20:39:25 +0000 (21:39 +0100)
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.

pgweb/news/util.py
templates/news/mail/pgproject.html

index c14e39f7387190f860708b60bced338b95876828..8e9693f11e0aadc121b4016bada22965f2b1c25a 100644 (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()
index 68e70d007474eabb49d0827d73a33a096594df2c..4b96ed8319b3e1d59ba894012a815e7dd050b7d5 100644 (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}}