diff --git a/docs/publish.md b/docs/publish.md index 56995128..5cef10cf 100644 --- a/docs/publish.md +++ b/docs/publish.md @@ -3213,10 +3213,10 @@ You can forward messages to e-mail by specifying an address in the header. This you'd like to persist longer, or to blast-notify yourself on all possible channels. Usage is easy: Simply pass the `X-Email` header (or any of its aliases: `X-E-mail`, `Email`, `E-mail`, `Mail`, or `e`). -Only one e-mail address is supported. If the server has [`smtp-sender-verify`](config.md#e-mail-notifications) enabled, +Only one e-mail address is supported. If the server has [`smtp-sender-verify`](config.md#e-mail-notifications) enabled (ntfy.sh has this enabled), you can also pass `yes`, `true`, or `1` to send to your first verified email address. -Since ntfy does not provide auth (yet), the rate limiting is pretty strict (see [limitations](#limitations)). In the +ntfy allows anonymous email sending (if enabled), so the rate limiting is pretty strict (see [limitations](#limitations)). In the default configuration, you get **16 e-mails per visitor** (IP address) and then after that one per hour. On top of that, your IP address appears in the e-mail body. This is to prevent abuse. diff --git a/docs/releases.md b/docs/releases.md index 865b10bd..93361d0a 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -15,13 +15,14 @@ Please check out the release notes for [upcoming releases](#not-released-yet) be ### ntfy server v2.21.0 Released March 30, 2026 -This is a change that is required because ntfy.sh was used to send unsolicited emails and the AWS SES account was -suspended. Going forward, ntfy.sh won't be able to send emails unless the email address was verified ahead of time. +This release add the ability to verify email addresses using the `smtp-sender-verify` flag. This is a change that is +required because ntfy.sh was used to send unsolicited emails and the AWS SES account was suspended. Going forward, +ntfy.sh won't be able to send emails unless the email address was verified ahead of time. **Features:** * Add verified email recipients feature with `smtp-sender-verify` config flag, allowing server admins to require email - address verification before sending email notifications + address verification before sending email notifications ([#1681](https://github.com/binwiederhier/ntfy/pull/1681)) ### ntfy server v2.20.1 Released March 27, 2026 diff --git a/server/server.go b/server/server.go index 89abe518..78a668bd 100644 --- a/server/server.go +++ b/server/server.go @@ -1105,7 +1105,7 @@ func (s *Server) sendToFirebase(v *visitor, m *model.Message) { } func (s *Server) sendEmail(v *visitor, m *model.Message, email string) { - logvm(v, m).Tag(tagEmail).Field("email", email).Debug("Sending email to %s", email) + logvm(v, m).Tag(tagEmail).Field("email", email).Info("Sending email to %s", email) if err := s.smtpSender.Send(v, m, email); err != nil { logvm(v, m).Tag(tagEmail).Field("email", email).Err(err).Warn("Unable to send email to %s: %v", email, err.Error()) minc(metricEmailsPublishedFailure) diff --git a/server/smtp_sender.go b/server/smtp_sender.go index 30966267..885f806b 100644 --- a/server/smtp_sender.go +++ b/server/smtp_sender.go @@ -43,9 +43,8 @@ func (s *smtpSender) Send(v *visitor, m *model.Message, to string) error { }) if ev.IsTrace() { ev.Field("email_body", message).Trace("Sending email") - } else if ev.IsDebug() { - ev.Info("Sending email") } + ev.Info("Sending email") return s.sender.SendRaw(to, []byte(message)) }) } diff --git a/user/manager_postgres.go b/user/manager_postgres.go index efa9998e..02cffd84 100644 --- a/user/manager_postgres.go +++ b/user/manager_postgres.go @@ -209,7 +209,7 @@ const ( postgresDeletePhoneNumberQuery = `DELETE FROM user_phone WHERE user_id = $1 AND phone_number = $2` // Email queries - postgresSelectEmailsQuery = `SELECT email FROM user_email WHERE user_id = $1` + postgresSelectEmailsQuery = `SELECT email FROM user_email WHERE user_id = $1 ORDER BY email` postgresInsertEmailQuery = `INSERT INTO user_email (user_id, email) VALUES ($1, $2)` postgresDeleteEmailQuery = `DELETE FROM user_email WHERE user_id = $1 AND email = $2` diff --git a/user/manager_sqlite.go b/user/manager_sqlite.go index 8db75cad..0f1a9227 100644 --- a/user/manager_sqlite.go +++ b/user/manager_sqlite.go @@ -208,7 +208,7 @@ const ( sqliteDeletePhoneNumberQuery = `DELETE FROM user_phone WHERE user_id = ? AND phone_number = ?` // Email queries - sqliteSelectEmailsQuery = `SELECT email FROM user_email WHERE user_id = ?` + sqliteSelectEmailsQuery = `SELECT email FROM user_email WHERE user_id = ? ORDER BY email` sqliteInsertEmailQuery = `INSERT INTO user_email (user_id, email) VALUES (?, ?)` sqliteDeleteEmailQuery = `DELETE FROM user_email WHERE user_id = ? AND email = ?`