Preserve Milter SMTP reply code and text in delivery traces #289

Closed
opened 2026-11-04 08:49:44 +00:00 by StefanSa · 2 comments

When a Milter returns a custom SMTP reply, the client receives the full reply, but the delivery trace records only the ReplyCode action and its context. The reply code and rejection reason are missing, so an administrator cannot see why the Milter rejected the message from that trace.

The trace should retain the same SMTP code and text that the Milter returned. The proposed minimal fix adds them to the existing Code and Details event fields. The Admin trace renderer already supports both fields; SMTP behavior and response construction stay unchanged.

The existing Milter session test is extended to check the actual emitted event against the mock reply 321 test, along with the unchanged SMTP response. Previous focused validation passed: 5 tests passed, 0 failed, and 1 existing external-service test was ignored. Scoped formatting and diff checks also passed. No new production test or deployment was performed.

When a Milter returns a custom SMTP reply, the client receives the full reply, but the delivery trace records only the ReplyCode action and its context. The reply code and rejection reason are missing, so an administrator cannot see why the Milter rejected the message from that trace. The trace should retain the same SMTP code and text that the Milter returned. The proposed minimal fix adds them to the existing `Code` and `Details` event fields. The Admin trace renderer already supports both fields; SMTP behavior and response construction stay unchanged. The existing Milter session test is extended to check the actual emitted event against the mock reply `321 test`, along with the unchanged SMTP response. Previous focused validation passed: 5 tests passed, 0 failed, and 1 existing external-service test was ignored. Scoped formatting and diff checks also passed. No new production test or deployment was performed.
jcoffey-dev added the enhancement
priority
p3
labels 2026-11-04 18:34:54 +00:00
jcoffey-dev self-assigned this 2026-11-04 18:34:54 +00:00
Owner

Thanks Stefan, this is up as #293. Your commit is in there under your name, with a small follow-up on top that records the code as a number and keeps the two fields off the other actions. The milter tests pass here, 5 passed and the 1 external one ignored, same as you saw.

Thanks Stefan, this is up as #293. Your commit is in there under your name, with a small follow-up on top that records the code as a number and keeps the two fields off the other actions. The milter tests pass here, 5 passed and the 1 external one ignored, same as you saw.
Owner

Merged in #293, so it'll be in the next 27.1 RC. Thanks again Stefan.

Merged in #293, so it'll be in the next 27.1 RC. Thanks again Stefan.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: inbuxa/inbuxa-server#289