forked from Silverfish/proton-bridge
User agent detected by fake IMAP extension instead of AUTH callback
This commit is contained in:
@ -23,7 +23,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
imapid "github.com/ProtonMail/go-imap-id"
|
||||
"github.com/ProtonMail/proton-bridge/internal/bridge"
|
||||
"github.com/ProtonMail/proton-bridge/internal/events"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/listener"
|
||||
@ -45,9 +44,6 @@ type imapBackend struct {
|
||||
users map[string]*imapUser
|
||||
usersLocker sync.Locker
|
||||
|
||||
lastMailClient imapid.ID
|
||||
lastMailClientLocker sync.Locker
|
||||
|
||||
imapCache map[string]map[string]string
|
||||
imapCachePath string
|
||||
imapCacheLock *sync.RWMutex
|
||||
@ -87,9 +83,6 @@ func newIMAPBackend(
|
||||
users: map[string]*imapUser{},
|
||||
usersLocker: &sync.Mutex{},
|
||||
|
||||
lastMailClient: imapid.ID{imapid.FieldName: clientNone},
|
||||
lastMailClientLocker: &sync.Mutex{},
|
||||
|
||||
imapCachePath: cfg.GetIMAPCachePath(),
|
||||
imapCacheLock: &sync.RWMutex{},
|
||||
}
|
||||
@ -194,23 +187,6 @@ func (ib *imapBackend) CreateMessageLimit() *uint32 {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ib *imapBackend) setLastMailClient(id imapid.ID) {
|
||||
ib.lastMailClientLocker.Lock()
|
||||
defer ib.lastMailClientLocker.Unlock()
|
||||
|
||||
if name, ok := id[imapid.FieldName]; ok && ib.lastMailClient[imapid.FieldName] != name {
|
||||
ib.lastMailClient = imapid.ID{}
|
||||
for k, v := range id {
|
||||
ib.lastMailClient[k] = v
|
||||
}
|
||||
log.Warn("Mail Client ID changed to ", ib.lastMailClient)
|
||||
ib.bridge.SetCurrentClient(
|
||||
ib.lastMailClient[imapid.FieldName],
|
||||
ib.lastMailClient[imapid.FieldVersion],
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// monitorDisconnectedUsers removes users when it receives a close connection event for them.
|
||||
func (ib *imapBackend) monitorDisconnectedUsers() {
|
||||
ch := make(chan string)
|
||||
|
||||
Reference in New Issue
Block a user