mikaku / Monitorix

Monitorix is a free, open source, lightweight system monitoring tool.
https://www.monitorix.org
GNU General Public License v2.0
1.12k stars 167 forks source link

Email report with svg option #174

Closed Josue-T closed 7 years ago

Josue-T commented 7 years ago

Hello,

When we set the image_format option to svg on the web server it's ok. But when we want to send an email report the binary of the image are in svg, but in the in the mail Content-Type data is set to image/png and the extension is png. So the email client can't read this image. For example I find that in the email source code :

--_----------=_1484615272119070
Content-Disposition: inline; filename="logo_bot.png"
Content-Id: <image_logo>
Content-Transfer-Encoding: base64
Content-Type: image/png; name="logo_bot.png"

but after the binary is encoded in svg format. I think it should be adapted to image/svg+xml.

Thanks

mikaku commented 7 years ago

Hello,

The image_format option only affects the graphs generated by Monitorix, not the logos.

Besides this, I've seen that the module emailreports.pm doesn't honor that option and it always uses the same mime type image/png, even when that option is set to SVG. Also, the module traffacct.pm has the same problem.

I'll fix this.

Josue-T commented 7 years ago

Hello,

I didn't see that my example is about the logo picture, I knew that it's only about the graphs.

Thanks to fix this.

mikaku commented 7 years ago

@Josue-T, no problem.

I've also fixed to name correctly each attached graph in the email, so now you should be able to save the graphs more easily.