Messages are sent in HTML with text/plain content type
Describe the bug Messages are sent in HTML with text/plain content type - so they are unreadable
Subject: Defguard: new device added to your account
Date: Tue, 03 Jun 2025 13:30:09 +0000
Mime-Version: 1.0
Content-Type: **text/plain**; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
<!doctype html>
<html xmlns=3D"http://www.w3.org/1999/xhtml" xmlns:v=3D"urn:schemas-microso=
ft-com:vml"
xmlns:o=3D"urn:schemas-microsoft-com:office:office">
To Reproduce Send any mail
Version information
- Defguard Core version: v1.2.4
Screenshots
@moubctez Assign to Kuba: send messages in plain text and HTML
@tema-mazy Please specify what email client (and version) you see this errors in. In typical we test (macOS apple mail, gmail, ...) we can't reproduce the bug.. thank you
@teon thanks for taking attention to this issue,
no matter what client is - apple mail, gmail web etc. the message body has wrong content type set and does not display properly.
so if you are sending html messages - you must use
Content-Type: text/plain; charset="UTF-8"
best practice is to send multipart messages - with both text and HTML parts.
`MIME-Version: 1.0
--_part-s0l2BWWS5A9o6GyqII3ygA Content-Type: multipart/alternative; boundary="_part-8X2H-tQVdLqY8d5lldzSjw"
--_part-8X2H-tQVdLqY8d5lldzSjw Content-Type: text/plain; charset="UTF-8"
TEXT VERSION
--_part-8X2H-tQVdLqY8d5lldzSjw Content-Type: multipart/related; boundary="_av--byNXhbcNI9bgr_GYduNbw"
--_part--byNXhbcNI9bgr_GYduNbw Content-Type: text/html; charset="UTF-8"
@tema-mazy Defguard Core v1.2.4 always sends email with Content-Type=text/html. Isn't your mail processed by the mail server somehow? What if you try a different mail server?
we do not have problems with other software sending via this server. mails sent in html - shows ok
"Defguard Core v1.2.4 always sends email with Content-Type=text/html."
maybe you have wrong headers.
i have created simple html mime message and sent it via
sendmail -i -- [email protected] < message
- it shows as html, and this is not multipart
also defguard-style message ( without mime type and message-id) - not shown as html
the difference - MIME-Version: 1.0 header
with it - message processeed corrrectly. without - no
missed in release 1.5.0