Community discussions

MikroTik App
 
abbio90
Member Candidate
Member Candidate
Topic Author
Posts: 246
Joined: Fri Aug 27, 2021 9:16 pm
Contact:

Image body email

Wed Apr 10, 2024 10:47 pm

Hello, Is it possible with Mikrotik to insert an image in the text of the email instead of as an attachment?
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3597
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: Image body email

Thu Apr 11, 2024 12:29 am

Short Answer is NO.

It kinda up to the mail client to figure it out. For sure, the file extension has to match the file type (e.g. if it's a png, name should end in .png)

But how Mikrotik generates the multipart MIME has some effects. Basically all attachments get added using the follow headers for file attachments:
Content-Type: application/octet-stream; charset=US-ASCII; name="test.png"
Content-Transfer-Encoding: BASE64
Content-Disposition: attachment; filename="test.png"
Issue is some mail client like Gmail or Outlook looks at "Content-Type" not being a graphic type and then the "Content-Disposition: attachment;" (e.g. Content-Disposition: inline is how something should flag inline graphics). Now a few mail client like Apple Mail app are pretty aggressive at inlining, so just the extension of the file name is enough to cause inline graphics (and they ignore the MIME that saying otherwise).

But these MIME headers are not controllable even via CLI. And you cannot just use body to insert add'l MIME parts with the image since RouterOS will adjust the MIME boundary marks to make sure body is only one MIME part. Or use HTML either...

Perhaps you can file a feature request at help.mikrotik.com. Since it could be argued that Mikrotik should look at the file extension for attachment, to set the MIME content-type/disposition based on file extension of any files=. And technically speaking "Content-Disposition" is NOT required on a MIME part. But I wouldn't bet on changes anytime soon, but doesn't hurt to ask.
 
abbio90
Member Candidate
Member Candidate
Topic Author
Posts: 246
Joined: Fri Aug 27, 2021 9:16 pm
Contact:

Re: Image body email

Thu Apr 11, 2024 10:14 am

Thank you for your answer. As suggested I interface with help.mikrotik.com

Who is online

Users browsing this forum: Bing [Bot], GoogleOther [Bot], koolandrew and 22 guests