EI1 and EM1 macros not working in Thunderbird or on iPhone

Current Development version likely to have breaking changes
Post Reply
akg1508
Posts: 26
Joined: Sun Aug 02, 2015 9:06 am

EI1 and EM1 macros not working in Thunderbird or on iPhone

Post by akg1508 »

Hi All,

The image macros (%EI1%, %EM1%, etc.) appear to be generating badly formed content when viewed in Thunderbird or the Apple iPhone email program.

The relevant part of the email source is:
This is a multi-part message in MIME format.

--_----------=_169484928125998620
Content-Transfer-Encoding: binary
Content-Type: multipart/related; boundary="_----------=_169484928125998621"
MIME-Version: 1.0
X-Mailer: MIME::Lite 3.033 (F2.85; T2.22; A2.21; B3.16; Q3.16)
Date: Sat, 16 Sep 2023 09:28:01 +0200

This is a multi-part message in MIME format.

--_----------=_169484928125998621
Content-Disposition: inline
Content-Type: text/plain
MIME-Version: 1.0
X-Mailer: MIME::Lite 3.033 (F2.85; T2.22; A2.21; B3.16; Q3.16)
Date: Sat, 16 Sep 2023 09:28:01 +0200
Content-Transfer-Encoding: quoted-printable

ZM alarm detected

<img src="cid:00001-capture.jpg"/>

<img src="cid:00003-capture.jpg"/>

--_----------=_169484928125998621
Content-Disposition: inline; filename="00001-capture.jpg"
Content-Id: <00001-capture.jpg>
Content-Transfer-Encoding: base64
Content-Type: image/jpeg; name="00001-capture.jpg"

/9j/4AAQSkZJRgABAgAAAQABAAD//gARTGF2YzU4LjEzNC4xMDAA/9sAQwAI
Dg4QDhATExMTExMWFRYXFxcWFhYWFxcXGRkZHR0dGRkZFxcZGRwcHR0gISAe
...

This appears in Thunderbird and iPhone email as links with no attachment:
ZM alarm detected

<img src="cid:00001-capture.jpg"/>

<img src="cid:00003-capture.jpg"/>
Looking at the eml file shows that the attachments are there (as shown above). Manually removing the links and resending the message then successfully shows the image, although as an attachment, not inline.

I'm not familiar with perl, php or CakeEmail. I can see that zmfilter.pl does the macro substitution, but no idea what the correct fix is to get this displaying correctly in Thunderbird and iPhone mail.

Anyone have a fix?

ZoneMinder 1.37.43
Linux domcich1 5.15.0-83-generic #92-Ubuntu SMP Mon Aug 14 09:30:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Thanks!
Alistair
akg1508
Posts: 26
Joined: Sun Aug 02, 2015 9:06 am

Re: EI1 and EM1 macros not working in Thunderbird or on iPhone

Post by akg1508 »

The cause of Thunderbird and iPhone not displaying the images in-line is placing the images in a nested multipart message.

I've checked that it appears correctly in Thunderbird, web gmail, iOS iPhone email, fastmail web mail and fastmail iOS email.

Issue: https://github.com/ZoneMinder/zoneminder/issues/3768
PR: https://github.com/ZoneMinder/zoneminder/pull/3769
akg1508
Posts: 26
Joined: Sun Aug 02, 2015 9:06 am

Re: EI1 and EM1 macros not working in Thunderbird or on iPhone

Post by akg1508 »

@iconnor is reporting that the PR isn't necessary as attachments and links work fine for him in Thunderbird. (I'm also seeing it in the iPhone email client).

Can someone else confirm that they're seeing the same issues as me (images not appearing, or appearing as attachments), or am I the only one?

For reference:

- The server is v1.37.45 on Ubuntu 22.04.3, installed with the official ppa.
- Thunderbird 115.2.2 on NixOS 23.05.

Thanks,
Alistair
akg1508
Posts: 26
Joined: Sun Aug 02, 2015 9:06 am

Re: EI1 and EM1 macros not working in Thunderbird or on iPhone

Post by akg1508 »

Thanks to @iconnor for suggesting converting the message from plain text to html, all the images are now rendered as expected.

Original message at https://github.com/ZoneMinder/zoneminde ... 1892796826
Post Reply