[GH-ISSUE #1685] Email notification using curl doesn't work anymore #1172

Closed
opened 2026-05-07 00:30:49 +02:00 by BreizhHardware · 4 comments

Originally created by @amadvance on GitHub (Apr 1, 2026).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1685

🐞 Describe the bug

Sending email notifications using curl doesn't work anymore from some days. It fails with HTTP error 400. If I remove the corresponding email header, the notification is working.

For example, this is a failure:

$ curl -f -H "Title: MyTitle" -H "Email: mymail@gmail.com" -d "Test" https://ntfy.sh/XXXXXXXX
curl: (22) The requested URL returned error: 400

💻 Components impacted

Email notification from curl

💡 Screenshots and/or logs

Here a curl verbose command that fail using "Email:yes". Same output using my real email :

$ curl -v -f -H "Title: MyTitle" -H "Email: yes" -d "Test" https://ntfy.sh/XXXXXXXX
*   Trying 159.203.148.75:443...
* Connected to ntfy.sh (159.203.148.75) port 443 (#0)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: none
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=ntfy.sh
*  start date: Mar 12 08:30:34 2026 GMT
*  expire date: Jun 10 08:30:33 2026 GMT
*  subjectAltName: host "ntfy.sh" matched cert's "ntfy.sh"
*  issuer: C=US; O=Let's Encrypt; CN=R12
*  SSL certificate verify ok.
* using HTTP/2
* h2h3 [:method: POST]
* h2h3 [:path: /XXXXXXXX]
* h2h3 [:scheme: https]
* h2h3 [:authority: ntfy.sh]
* h2h3 [user-agent: curl/8.0.1]
* h2h3 [accept: */*]
* h2h3 [title: MyTitle]
* h2h3 [email: yes]
* h2h3 [content-length: 4]
* h2h3 [content-type: application/x-www-form-urlencoded]
* Using Stream ID: 1 (easy handle 0x122dda0)
> POST /XXXXXXXX HTTP/2
> Host: ntfy.sh
> user-agent: curl/8.0.1
> accept: */*
> title: MyTitle
> email: yes
> content-length: 4
> content-type: application/x-www-form-urlencoded
> 
* We are completely uploaded and fine
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/2 400 
< server: nginx
< date: Wed, 01 Apr 2026 11:31:59 GMT
< content-type: application/json
< content-length: 152
< access-control-allow-origin: *
* The requested URL returned error: 400
* Connection #0 to host ntfy.sh left intact
curl: (22) The requested URL returned error: 400

🔮 Additional context

I have a free account on https://ntfy.sh
I have my email verified
I have not reached the mail limit of 5
My account is subscribed to the topic I send to
Using -H "Email: yes" gets the same error than using -H "Email: mymail@gmail.com"
Sending a notification with email from the web interface is working

Originally created by @amadvance on GitHub (Apr 1, 2026). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1685 :lady_beetle: **Describe the bug** <!-- A clear and concise description of the problem. --> Sending email notifications using curl doesn't work anymore from some days. It fails with HTTP error 400. If I remove the corresponding email header, the notification is working. For example, this is a failure: ``` $ curl -f -H "Title: MyTitle" -H "Email: mymail@gmail.com" -d "Test" https://ntfy.sh/XXXXXXXX curl: (22) The requested URL returned error: 400 ``` :computer: **Components impacted** <!-- ntfy server, Android app, iOS app, web app --> Email notification from curl :bulb: **Screenshots and/or logs** <!-- If applicable, add screenshots or share logs help explain your problem. To get logs from the ... - ntfy server: Enable "log-level: trace" in your server.yml file - Android app: Go to "Settings" -> "Record logs", then eventually "Copy/upload logs" - web app: Press "F12" and find the "Console" window --> Here a curl verbose command that fail using "Email:yes". Same output using my real email : ``` $ curl -v -f -H "Title: MyTitle" -H "Email: yes" -d "Test" https://ntfy.sh/XXXXXXXX * Trying 159.203.148.75:443... * Connected to ntfy.sh (159.203.148.75) port 443 (#0) * ALPN: offers h2,http/1.1 * TLSv1.3 (OUT), TLS handshake, Client hello (1): * CAfile: none * CApath: /etc/ssl/certs * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8): * TLSv1.3 (IN), TLS handshake, Certificate (11): * TLSv1.3 (IN), TLS handshake, CERT verify (15): * TLSv1.3 (IN), TLS handshake, Finished (20): * TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1): * TLSv1.3 (OUT), TLS handshake, Finished (20): * SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 * ALPN: server accepted h2 * Server certificate: * subject: CN=ntfy.sh * start date: Mar 12 08:30:34 2026 GMT * expire date: Jun 10 08:30:33 2026 GMT * subjectAltName: host "ntfy.sh" matched cert's "ntfy.sh" * issuer: C=US; O=Let's Encrypt; CN=R12 * SSL certificate verify ok. * using HTTP/2 * h2h3 [:method: POST] * h2h3 [:path: /XXXXXXXX] * h2h3 [:scheme: https] * h2h3 [:authority: ntfy.sh] * h2h3 [user-agent: curl/8.0.1] * h2h3 [accept: */*] * h2h3 [title: MyTitle] * h2h3 [email: yes] * h2h3 [content-length: 4] * h2h3 [content-type: application/x-www-form-urlencoded] * Using Stream ID: 1 (easy handle 0x122dda0) > POST /XXXXXXXX HTTP/2 > Host: ntfy.sh > user-agent: curl/8.0.1 > accept: */* > title: MyTitle > email: yes > content-length: 4 > content-type: application/x-www-form-urlencoded > * We are completely uploaded and fine * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): * old SSL session ID is stale, removing < HTTP/2 400 < server: nginx < date: Wed, 01 Apr 2026 11:31:59 GMT < content-type: application/json < content-length: 152 < access-control-allow-origin: * * The requested URL returned error: 400 * Connection #0 to host ntfy.sh left intact curl: (22) The requested URL returned error: 400 ``` :crystal_ball: **Additional context** <!-- Add any other context about the problem here. --> I have a free account on https://ntfy.sh I have my email verified I have not reached the mail limit of 5 My account is subscribed to the topic I send to Using -H "Email: yes" gets the same error than using -H "Email: mymail@gmail.com" Sending a notification with email from the web interface is working
BreizhHardware 2026-05-07 00:30:49 +02:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@binwiederhier commented on GitHub (Apr 1, 2026):

You are correct. Your limit hasn't been reached. But the error is also a HTTP 400, not a 429, so it's a problem with the request itself. What is the exact error? Try the curl without the -f. That'll give you a response with details.

<!-- gh-comment-id:4169921167 --> @binwiederhier commented on GitHub (Apr 1, 2026): You are correct. Your limit hasn't been reached. But the error is also a HTTP 400, not a 429, so it's a problem with the request itself. What is the exact error? Try the curl without the `-f`. That'll give you a response with details.
Author
Owner

@amadvance commented on GitHub (Apr 1, 2026):

Without -f I get:

$ curl  -H "Title: MyTitle" -H "Email: yes" -d "Test" https://ntfy.sh/amadvance34938
{"code":40053,"http":400,"error":"invalid request: anonymous email sending is not allowed","link":"https://ntfy.sh/docs/publish/#e-mail-notifications"}
<!-- gh-comment-id:4171462050 --> @amadvance commented on GitHub (Apr 1, 2026): Without -f I get: ``` $ curl -H "Title: MyTitle" -H "Email: yes" -d "Test" https://ntfy.sh/amadvance34938 {"code":40053,"http":400,"error":"invalid request: anonymous email sending is not allowed","link":"https://ntfy.sh/docs/publish/#e-mail-notifications"} ```
Author
Owner

@binwiederhier commented on GitHub (Apr 1, 2026):

You're not sending as a user. You need to pass an auth header: https://docs.ntfy.sh/publish/#authentication

<!-- gh-comment-id:4171553027 --> @binwiederhier commented on GitHub (Apr 1, 2026): You're not sending as a user. You need to pass an auth header: https://docs.ntfy.sh/publish/#authentication
Author
Owner

@amadvance commented on GitHub (Apr 1, 2026):

OK. Thanks!

<!-- gh-comment-id:4172052288 --> @amadvance commented on GitHub (Apr 1, 2026): OK. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#1172
No description provided.