mirror of
https://github.com/mjl-/mox.git
synced 2025-07-14 04:14:37 +03:00
webmail: fix loading a "view" (messages in a mailbox) when the "initial" message cannot be parsed
when we send a list of messages from the mox backend to the js frontend, we include a parsed form of the "initial" message: the one we immediately show, typically the top-most (unread) message. however, if that message could not be parsed (due to invalid header syntax), we would fail the entire operation of loading the view. with this change, we simply don't return a parsed form of an initial message if we cannot parse it. that will cause the webmail frontend to not select & display a message immediately. if you then try to open the message, you'll still get an error message as before. but at least the view has been loaded, and you can open the raw message to inspect the contents. for issue #219 by wneessen
This commit is contained in:
@ -232,7 +232,7 @@ func parsedMessage(log mlog.Log, m store.Message, state *msgState, full, msgitem
|
||||
if full && state.part.BodyOffset > 0 {
|
||||
hdrs, err := state.part.Header()
|
||||
if err != nil {
|
||||
return ParsedMessage{}, fmt.Errorf("parsing headers: %v", err)
|
||||
return ParsedMessage{}, fmt.Errorf("parsing headers: %w", err)
|
||||
}
|
||||
pm.Headers = hdrs
|
||||
|
||||
|
Reference in New Issue
Block a user