msgpipeline: Use HeaderField.Raw when copying fields around

To make sure the formatting is preserved. This is important for e.g.
DKIM signatures.
This commit is contained in:
fox.cpp 2020-05-04 22:18:06 +03:00
parent e06f2e201c
commit d8a6f9dd22
No known key found for this signature in database
GPG key ID: 5B991F6215D2FCC0
3 changed files with 5 additions and 3 deletions

View file

@ -171,7 +171,7 @@ func (cr *checkRunner) runAndMergeResults(states []module.CheckState, runner fun
if subCheckRes.Header.Len() != 0 {
data.headerLock.Lock()
for field := subCheckRes.Header.Fields(); field.Next(); {
cr.mergedRes.Header.Add(field.Key(), field.Value())
cr.mergedRes.Header.AddRaw(field.Raw())
}
data.headerLock.Unlock()
}
@ -303,7 +303,7 @@ func (cr *checkRunner) applyResults(hostname string, header *textproto.Header) e
}
for field := cr.mergedRes.Header.Fields(); field.Next(); {
header.Add(field.Key(), field.Value())
header.AddRaw(field.Raw())
}
return nil
}