Re: Images in news mails

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Images in news mails
Дата
Msg-id CABUevExfO2oP=h==31c1XM=OsiCc4tbSGZorJ-V3EwAbNaAJBQ@mail.gmail.com
обсуждение исходный текст
Ответ на Images in news mails  (Tobias Bussmann <t.bussmann@gmx.net>)
Список pgsql-www


On Thu, 4 Sept 2025 at 21:49, Tobias Bussmann <t.bussmann@gmx.net> wrote:
Ever since HTML emails were introduced for project news in around 2020, I have wondered why, on my system (macOS using Apple Mail as the MUA), emails were sometimes displayed in a distorted way. Today, I took the time to track it down. Apple Mail ignores the size if the image source is provided inline via CID and not referenced externally [2, footnote 3]. As a workaround, the width can be specified again in the 'style' tag, as I have done in the attached patch.

Another issue is that the Slonik logo is displayed again at the end of the email. In contrast to the first issue, this affects the Mail app on iOS as well. My analysis suggests that this is caused by the MIME structure of the email:
- multipart/mixed
  - multipart/alternative
    - text/plain
    - text/html
  - image/png with Content-Disposition: inline

This issue is resolved if I change the structure to the following:
- multipart/alternative
  - text/plain
  - multipart/related
    - text/html
    - image/png with Content-Disposition: inline


Wow, this was a lot of fun. Not.

I have changed the code to restructure like this and it mostly works. It now breaks in the gmail app on android when connected to our company emulated-exchange interface. But it fixes apple mail. I think there are a lot more apple mail out there, so I think it's a strict improvement :)

Thanks for the diagnosing work! I hope this does properly fix it!

//Magnus

В списке pgsql-www по дате отправления: