GODT-1754: Add logs for unilateral updates and SEARCH.

This commit is contained in:
Jakub
2022-08-02 12:39:48 +02:00
parent bdb35f1c1d
commit 9bb16dec48
9 changed files with 112 additions and 73 deletions

View File

@ -53,6 +53,9 @@ type imapUser struct {
// not cause huge slow down as EXPUNGE is implicitly called also after
// UNSELECT, CLOSE, or LOGOUT.
appendExpungeLock sync.Mutex
addressID string // cached value for logs to avoid lock
mailboxIDs map[string]string // cached values for logs to avoid lock
}
// newIMAPUser returns struct implementing go-imap/user interface.
@ -84,6 +87,8 @@ func newIMAPUser(
storeAddress: storeAddress,
currentAddressLowercase: strings.ToLower(address),
addressID: addressID,
mailboxIDs: map[string]string{},
}, err
}
@ -128,6 +133,8 @@ func (iu *imapUser) ListMailboxes(showOnlySubcribed bool) ([]goIMAPBackend.Mailb
mailboxes := []goIMAPBackend.Mailbox{}
for _, storeMailbox := range iu.storeAddress.ListMailboxes() {
iu.mailboxIDs[storeMailbox.Name()] = storeMailbox.LabelID()
if storeMailbox.LabelID() == pmapi.AllMailLabel && !iu.backend.bridge.IsAllMailVisible() {
continue
}