diff --git a/webmail/api.go b/webmail/api.go index 9d07f6263..21e490daa 100644 --- a/webmail/api.go +++ b/webmail/api.go @@ -204,8 +204,10 @@ func fromAddrViewMode(tx *bstore.Tx, from MessageAddress) (store.ViewMode, error err = tx.Get(&fas) if err == bstore.ErrAbsent { return settingsViewMode() + } else if err != nil { + return store.ModeText, err } - return fas.ViewMode, err + return fas.ViewMode, nil } // FromAddressSettingsSave saves per-"From"-address settings. diff --git a/webmail/message.go b/webmail/message.go index 53f65ae1a..9237624c7 100644 --- a/webmail/message.go +++ b/webmail/message.go @@ -181,6 +181,8 @@ func formatFirstLine(r io.Reader) (string, error) { } func parsedMessage(log mlog.Log, m store.Message, state *msgState, full, msgitem bool) (pm ParsedMessage, rerr error) { + pm.ViewMode = store.ModeText // Valid default, in case this makes it to frontend. + if full || msgitem { if !state.ensurePart(m, true) { return pm, state.err