mirror of
https://github.com/mjl-/mox.git
synced 2025-07-19 06:46:37 +03:00
message: when parsing a message, don't treat absent header and empty header value the same
We now use "*string" for such header fields, for Content-* fields, as used in the imapserver when responding to FETCH commands. We'll now return NIL for an absent header, and "" (empty string) if the header value is empty.
This commit is contained in:
@ -898,7 +898,7 @@ func inlineSanitizeHTML(log mlog.Log, setHeaders func(), w io.Writer, p *message
|
||||
func findCID(p *message.Part, parents []*message.Part, cid string) *message.Part {
|
||||
for i := len(parents) - 1; i >= 0; i-- {
|
||||
for j, pp := range parents[i].Parts {
|
||||
if strings.EqualFold(pp.ContentID, cid) {
|
||||
if pp.ContentID != nil && strings.EqualFold(*pp.ContentID, cid) {
|
||||
return &parents[i].Parts[j]
|
||||
}
|
||||
}
|
||||
@ -911,7 +911,7 @@ func findCID(p *message.Part, parents []*message.Part, cid string) *message.Part
|
||||
}
|
||||
|
||||
func findCIDAll(p *message.Part, cid string) *message.Part {
|
||||
if strings.EqualFold(p.ContentID, cid) {
|
||||
if p.ContentID != nil && strings.EqualFold(*p.ContentID, cid) {
|
||||
return p
|
||||
}
|
||||
for i := range p.Parts {
|
||||
|
Reference in New Issue
Block a user