Skip to content

Commit bf982eb

Browse files
committed
msgpipeline: Fix wrong effective_rcpt in log messages when sub-pipelines do rewriting
1 parent 32cf84e commit bf982eb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

internal/msgpipeline/msgpipeline.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,15 @@ func (dd *msgpipelineDelivery) AddRcpt(ctx context.Context, to string) error {
343343
}
344344

345345
for _, tgt := range rcptBlock.targets {
346+
// Do not wrap errors coming from nested pipeline target delivery since
347+
// that pipeline itself will insert effective_rcpt field and could do
348+
// its own rewriting - we do not want to hide it from the admin in
349+
// error messages.
350+
wrapErr := wrapErr
351+
if _, ok := tgt.(*MsgPipeline); ok {
352+
wrapErr = func(err error) error { return err }
353+
}
354+
346355
delivery, err := dd.getDelivery(ctx, tgt)
347356
if err != nil {
348357
return wrapErr(err)

0 commit comments

Comments
 (0)