[GH-ISSUE #839] go-smtp breaking API changes, again .. #591

Open
opened 2026-05-07 00:25:39 +02:00 by BreizhHardware · 1 comment

Originally created by @binwiederhier on GitHub (Aug 17, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/839

go-smtp v0.18.0 breaks the API again. For now it's pinned to v0.17.0

Originally created by @binwiederhier on GitHub (Aug 17, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/839 go-smtp v0.18.0 breaks the API again. For now it's pinned to v0.17.0
Author
Owner

@thekhalifa commented on GitHub (Dec 15, 2024):

Hi, when packaging ntfy for debian, the version of go-smtp was too low, so I experimented with raising it to v0.21.2 and found these to be the main differences:

  1. smtp.Session.Rcpt() signature changes to add RcptOptions - this is additional, so safe to add in the one instance in server/smtp_server.go

  2. smtp_server_test: SMTP conversation status messages have changed, so they break some of the tests. This is easy to fix but requires the check condition to be strings.HasPrefix() instead of equality

  • 250 2.0.0 OK: queued -> 250 2.0.0 Roger, accepting mail...

  • 554 5.0.0 Error: transaction failed, blame it on the weather -> 554 5.0.0 Error: transaction failed...

  1. smtp_server_test: Some tests that are expected to fail are now passing. I tried to trace why they failed, but didn't get anywhere. These were the tests I found passing:
  • TestSmtpBackend_Unsupported
  • TestSmtpBackend_NestedMultipartTooDeep

Was there anything else that blocked you from updating to the higher version?
Are there any plans to update the version (or accept a PR for it?)

Thanks.

<!-- gh-comment-id:2543979239 --> @thekhalifa commented on GitHub (Dec 15, 2024): Hi, when packaging ntfy for debian, the version of go-smtp was too low, so I experimented with raising it to v0.21.2 and found these to be the main differences: 1. smtp.Session.Rcpt() signature changes to add RcptOptions - this is additional, so safe to add in the one instance in server/smtp_server.go 2. smtp_server_test: SMTP conversation status messages have changed, so they break some of the tests. This is easy to fix but requires the check condition to be strings.HasPrefix() instead of equality - > 250 2.0.0 OK: queued -> 250 2.0.0 Roger, accepting mail... - > 554 5.0.0 Error: transaction failed, blame it on the weather -> 554 5.0.0 Error: transaction failed... 3. smtp_server_test: Some tests that are expected to fail are now passing. I tried to trace why they failed, but didn't get anywhere. These were the tests I found passing: - TestSmtpBackend_Unsupported - TestSmtpBackend_NestedMultipartTooDeep Was there anything else that blocked you from updating to the higher version? Are there any plans to update the version (or accept a PR for it?) 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#591
No description provided.