louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
57.21k stars 5.15k forks source link

Email notification not sent on monitor down #5009

Closed Giantvince1 closed 2 months ago

Giantvince1 commented 2 months ago

📑 I have found these related issues/pull requests

I found other issues that mention being unable to receive notifications on monitor going down, but none relate to SMTP email notifications.

🛡️ Security Policy

Description

Anytime a monitor goes down, I don't get an email notification until the service comes back up. This occurs at least for HTTPS and TCP port monitor types, though it may occur for others as well. I still get notifications when the monitors come back up however, without modifying the notifiers at all, and there's no filter option to exclusively send on up instead of down.

👟 Reproduction steps

  1. Create a monitor (HTTP(s), TCP port are the two confirmed).
  2. Setup SMTP email notification for each monitor.
  3. Stop hosting whichever service you're testing notifications for (EXCLUDING EMAIL), and wait 5 minutes. No email will come in.
  4. Resume the service. Email immediately comes in on next ping/connect attempt.

👀 Expected behavior

I expect to be able to receive notifications whenever a service goes down without being in maintenance mode, instead of having to manually check the service(s).

😓 Actual Behavior

I never receive any notification about services going down outside of maintenance. I only receive notifications when the services are back up.

🐻 Uptime-Kuma Version

1.23.13

💻 Operating System and Arch

Ubuntu 22.04 amd64

🌐 Browser

Firefox 129.0 amd64, Windows 11 23H2

🖥️ Deployment Environment

📝 Relevant log output

No response

CommanderStorm commented 2 months ago
Giantvince1 commented 2 months ago

I'm my own email provider (own domain name, own mail server running iRedMail, mail works perfectly, tested on many occasions and up notifs work). I don't know how to find my mail-template let alone edit them, so it would be the docker image's default. Nothing from my email server touches spam, it lands in inbox 100% of the time. Even then, yes I checked, nothing ever arrived. DMARC even reported zero failures from GMail DMARC reporting (recipient is my GMail, sender is my other box in a different cloud provider from UK instance). I also need instructions on checking the log. I'm not familiar with Docker at all, but it is far easier to set-and-forget with two commands and install apache2 for reverse proxy on the host.

Giantvince1 commented 2 months ago

Update: I checked for logs, but found literally nothing. The only entry in my error log is a singular "invalid DKIM digest" error during setup of a notifier at 4AM. Up notifications have been working all day, as I've been testing it as a side-effect of doing some hotfixing to my other project. The only thing that hasn't worked at all yet, since installing the Docker container, is a service down alert email.

CommanderStorm commented 2 months ago

Please don't use GMail to recieve these mails. GMail does filter, changes subjects, ... for automated mails. They also reject custom mailers for a variety of issues.

Not being able to send emails to gmail is somewhat common.

What does the log of your mailserver look like?

Giantvince1 commented 2 months ago

Okay, so apparently they were landing in my spam folder. Just for some reason, Thunderbird wasn't catching it (unknown how; I'd clicked on it multiple times, only for it to come up empty). I just did so again after intentionally testing the trigger, and one appeared, along with the others that got completely missed. I'm sorry for wasting time.

CommanderStorm commented 2 months ago

FYI: Here is Theos video talking about the gmail-issue

Giantvince1 commented 2 months ago

I fixed the issue; I marked my noreply address using my domain as trusted so that they never land in spam, and automatically get labeled. It sucks on Gmail's part that I had to do so manually, even when I'm completely compliant with email best practice; that should not be the case for any reasonable email server.