From 14af5bbb1205ffda882a47b437c67e5f6ed75c4c Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Fri, 18 Apr 2025 09:05:09 +0200 Subject: [PATCH] when reparsing all messages, actually store the new mime structure in the database --- store/account.go | 2 +- store/reparse.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/store/account.go b/store/account.go index b1c4507..3bfd98c 100644 --- a/store/account.go +++ b/store/account.go @@ -983,7 +983,7 @@ type Upgrade struct { MessageParseVersion int // If different than latest, all messages will be reparsed. } -const MessageParseVersionLatest = 1 +const MessageParseVersionLatest = 2 // upgradeInit is the value for new account database, which don't need any upgrading. var upgradeInit = Upgrade{ diff --git a/store/reparse.go b/store/reparse.go index ba8d92b..e32b935 100644 --- a/store/reparse.go +++ b/store/reparse.go @@ -103,6 +103,7 @@ func (a *Account) ReparseMessages(ctx context.Context, log mlog.Log) (int, error if r.Err != nil { log.Errorx("marshal parsed form of message", r.Err, slog.Int64("msgid", r.Message.ID)) } else { + r.Message.ParsedBuf = r.Buf if err := tx.Update(r.Message); err != nil { return fmt.Errorf("update message: %w", err) } @@ -120,6 +121,7 @@ func (a *Account) ReparseMessages(ctx context.Context, log mlog.Log) (int, error if r.Err != nil { log.Errorx("marshal parsed form of message", r.Err, slog.Int64("msgid", r.Message.ID)) } else { + r.Message.ParsedBuf = r.Buf if err := tx.Update(r.Message); err != nil { return fmt.Errorf("update message with id %d: %w", r.Message.ID, err) }