mirror of
https://github.com/foxcpp/maddy.git
synced 2025-04-06 14:37:37 +03:00
msgpipeline: Run per-recipient body modifiers and checks
This commit is contained in:
parent
4a875e69dc
commit
aa2600aa50
2 changed files with 19 additions and 5 deletions
|
@ -311,8 +311,11 @@ func (dd *msgpipelineDelivery) Body(ctx context.Context, header textproto.Header
|
|||
if err := dd.checkRunner.checkBody(ctx, dd.sourceBlock.checks, header, body); err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO: Decide whether per-recipient body checks should be executed.
|
||||
|
||||
for blk := range dd.rcptModifiersState {
|
||||
if err := dd.checkRunner.checkBody(ctx, blk.checks, header, body); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := dd.checkRunner.applyResults(dd.d.Hostname, &header); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -325,6 +328,11 @@ func (dd *msgpipelineDelivery) Body(ctx context.Context, header textproto.Header
|
|||
if err := dd.sourceModifiersState.RewriteBody(ctx, &header, body); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, modifiers := range dd.rcptModifiersState {
|
||||
if err := modifiers.RewriteBody(ctx, &header, body); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
for _, delivery := range dd.deliveries {
|
||||
if err := delivery.Body(ctx, header, body); err != nil {
|
||||
|
@ -384,6 +392,12 @@ func (dd *msgpipelineDelivery) BodyNonAtomic(ctx context.Context, c module.Statu
|
|||
setStatusAll(err)
|
||||
return
|
||||
}
|
||||
for _, modifiers := range dd.rcptModifiersState {
|
||||
if err := modifiers.RewriteBody(ctx, &header, body); err != nil {
|
||||
setStatusAll(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
for _, delivery := range dd.deliveries {
|
||||
partDelivery, ok := delivery.Delivery.(module.PartialDelivery)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue