From f0b76ebb0d8c1a94489782dc3faf30773ae1c63f Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Thu, 19 Nov 2026 20:05:12 +0900 Subject: [PATCH] Make rdm-mailhandler.rb report a temporary failure on any error while contacting Redmine Only SystemCallError and IOError were rescued when posting the email to Redmine. Other errors such as a name resolution failure, a TLS error, a timeout, or a malformed response terminated the script with exit status 1. MTAs treat that status as a permanent failure, so the email was bounced instead of being retried. All errors raised while contacting Redmine are now rescued and reported with exit status 75 (EX_TEMPFAIL), in the same way as a refused connection, so that the MTA keeps the email in the queue and retries the delivery later. Co-Authored-By: Claude Fable 5.2 --- extra/mail_handler/rdm-mailhandler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/mail_handler/rdm-mailhandler.rb b/extra/mail_handler/rdm-mailhandler.rb index 0ea1b71a1..424ca32db 100644 --- a/extra/mail_handler/rdm-mailhandler.rb +++ b/extra/mail_handler/rdm-mailhandler.rb @@ -169,7 +169,7 @@ END_DESC debug "Posting to #{uri}..." begin response = Net::HTTPS.post_form(URI.parse(uri), data, headers, :no_check_certificate => no_check_certificate, :certificate_bundle => certificate_bundle) - rescue SystemCallError, IOError => e # connection refused, etc. + rescue => e # connection refused, etc. warn "An error occurred while contacting your Redmine server: #{e.message}" return 75 # temporary failure end -- 2.55.0