Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to send HTML emails #70

Open
MichaelCharles opened this issue Jul 26, 2022 · 3 comments
Open

Unable to send HTML emails #70

MichaelCharles opened this issue Jul 26, 2022 · 3 comments

Comments

@MichaelCharles
Copy link

MichaelCharles commented Jul 26, 2022

  • sensu-backend version: sensu-backend version 6.7.2+ee, enterprise edition, build e0d4063f2671a83ef64938c0ac7d2f3bd30e0a8d, built 2022-05-11T21:42:19Z, built with go1.17.6
  • sensu-agent version: sensu-backend version 6.7.2+ee, enterprise edition, build e0d4063f2671a83ef64938c0ac7d2f3bd30e0a8d, built 2022-05-11T21:42:19Z, built with go1.17.6
  • sensu-email-handler version: 1.2.2

sensu-backend is running on Ubuntu 20.04
sensu-agent is running on Windows Server 2019


I tried some simple HTML content, like so.

<html><head><style>p {color: red;}</style></head><body><h1>This was a triump.</h1><p>I'm making a note here: Huge success.</p></body></html>

It successfully uses the template, but it is sent as plaintext.

I also tried copy/pasting the template that is available in the documentation, and that also resulted in just plain text.

The following is an example of what I'm receiving as an email.

@MichaelCharles
Copy link
Author

Seems like it might have to do with the email provider we're using? Maybe?

We're using Sakura Internet as our email provider. And Sensu is using it to send emails to other accounts using Sakura email.

If I send an HTML email from Gmail to a Sakura email account, the HTML styles show up. You can't see any HTML tags.

If I use Sensu to send an email from a Sakura mail account to another Sakura mail account, the HTML styles do not show up and they display in plain text.

However, if I use an email client to send an HTML Email from a Sakura mail account, the HTML styles do show up and you can't see any HTML tags.

It's weird.

@MichaelCharles
Copy link
Author

Actually, it seems like it is a problem with Spark?

Or at the very least I've only been able to reproduce the problem when using the Spark client for MacOS.

@MichaelCharles
Copy link
Author

Here is a raw version of the email being generated (I changed some names/ids to protect sensitive information)

Return-Path: <sensu@example.com>
Received: from abcd123.sakura.ne.jp (abcd123.sakura.ne.jp [133.242.250.114])
	by www9999x.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 26Q24vXe005788
	for <michael@example.com>; Tue, 26 Jul 2022 11:04:57 +0900 (JST)
	(envelope-from sensu@example.com)
Received: from www9999x.sakura.ne.jp (49.212.168.72)
 by abcd123.sakura.ne.jp (F-Secure/fsigk_smtp/550/abcd123.sakura.ne.jp);
 Tue, 26 Jul 2022 11:04:57 +0900 (JST)
X-Virus-Status: clean(F-Secure/fsigk_smtp/550/abcd123.sakura.ne.jp)
Received: from localhost (l200068.ppp.asahi-net.or.jp [218.219.200.68])
	by www9999x.sakura.ne.jp (8.15.2/8.15.2) with ESMTPS id 99X99xXx009999
	(version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO)
	for <michael@example.com>; Tue, 26 Jul 2022 11:04:56 +0900 (JST)
	(envelope-from sensu@example.com)
Message-Id: <202207260204.99X99xXx009999@www9999x.sakura.ne.jp>
From: <sensu@example.com>
To: michael@example.com
Subject: Sensu Alert - (default) TestEntity/monkey-status-check: failing
Date: Tue, 26 Jul 2022 11:04:56 +0900
Content-Type: text/html


<html>
<head>
<style>
p {
	color: red;
}
</style>
</head>
<body>
<p>This is a test.</p>
</body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant