mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-15 14:56:42 +00:00
GODT-1260: Renaming
* Renaming GUI, CLI, no-impact config. * License header and documentation rebranding. * Rename app title and vendor. Impact: manual install * Migrating mac keychain and launch on startup. * Fix linter and linter renaming
This commit is contained in:
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Package imap provides IMAP server of the Bridge.
|
||||
//
|
||||
@ -75,7 +75,7 @@ func NewIMAPBackend(
|
||||
cache cacheProvider,
|
||||
setting settingsProvider,
|
||||
bridge *bridge.Bridge,
|
||||
) *imapBackend { //nolint[golint]
|
||||
) *imapBackend { //nolint:revive
|
||||
bridgeWrap := newBridgeWrap(bridge)
|
||||
|
||||
imapWorkers := setting.GetInt(settings.IMAPWorkers)
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
@ -115,7 +115,7 @@ func (ib *imapBackend) loadIMAPCache() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close() //nolint[errcheck]
|
||||
defer f.Close() //nolint:errcheck,gosec
|
||||
|
||||
return json.NewDecoder(f).Decode(&ib.imapCache)
|
||||
}
|
||||
@ -132,7 +132,7 @@ func (ib *imapBackend) saveIMAPCache() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close() //nolint[errcheck]
|
||||
defer f.Close() //nolint:errcheck,gosec
|
||||
|
||||
return json.NewEncoder(f).Encode(ib.imapCache)
|
||||
}
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
@ -61,7 +61,7 @@ func (b *bridgeWrap) GetUser(query string) (bridgeUser, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return newBridgeUserWrap(user), nil //nolint[typecheck] missing methods are inherited
|
||||
return newBridgeUserWrap(user), nil //nolint:typecheck missing methods are inherited
|
||||
}
|
||||
|
||||
type bridgeUserWrap struct {
|
||||
@ -77,5 +77,5 @@ func (u *bridgeUserWrap) GetStore() storeUserProvider {
|
||||
if store == nil {
|
||||
return nil
|
||||
}
|
||||
return newStoreUserWrap(store) //nolint[typecheck] missing methods are inherited
|
||||
return newStoreUserWrap(store) //nolint:typecheck missing methods are inherited
|
||||
}
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package id
|
||||
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package idle
|
||||
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
import "github.com/sirupsen/logrus"
|
||||
|
||||
var log = logrus.WithField("pkg", "imap") //nolint[gochecknoglobals]
|
||||
var log = logrus.WithField("pkg", "imap") //nolint:gochecknoglobals
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
@ -47,7 +47,7 @@ func (im *imapMailbox) CreateMessage(flags []string, date time.Time, body imap.L
|
||||
}, "APPEND", flags, date)
|
||||
}
|
||||
|
||||
func (im *imapMailbox) createMessage(imapFlags []string, date time.Time, r imap.Literal) error { //nolint[funlen]
|
||||
func (im *imapMailbox) createMessage(imapFlags []string, date time.Time, r imap.Literal) error { //nolint:funlen
|
||||
// Called from go-imap in goroutines - we need to handle panics for each function.
|
||||
defer im.panicHandler.HandlePanic()
|
||||
|
||||
@ -156,7 +156,7 @@ func findMailboxForAddress(address storeAddressProvider, labelID string) (storeM
|
||||
address.AddressString())
|
||||
}
|
||||
|
||||
func (im *imapMailbox) labelExistingMessage(msg storeMessageProvider) error { //nolint[funlen]
|
||||
func (im *imapMailbox) labelExistingMessage(msg storeMessageProvider) error { //nolint:funlen
|
||||
im.log.Info("Labelling existing message")
|
||||
|
||||
// IMAP clients can move message to local folder (setting \Deleted flag)
|
||||
@ -196,7 +196,7 @@ func (im *imapMailbox) labelExistingMessage(msg storeMessageProvider) error { //
|
||||
return uidplus.AppendResponse(im.storeMailbox.UIDValidity(), im.storeMailbox.GetUIDList([]string{msg.ID()}))
|
||||
}
|
||||
|
||||
func (im *imapMailbox) importMessage(kr *crypto.KeyRing, hdr textproto.Header, body []byte, imapFlags []string, date time.Time) error { //nolint[funlen]
|
||||
func (im *imapMailbox) importMessage(kr *crypto.KeyRing, hdr textproto.Header, body []byte, imapFlags []string, date time.Time) error { //nolint:funlen
|
||||
im.log.Info("Importing external message")
|
||||
|
||||
var (
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
@ -87,7 +87,7 @@ func (im *imapMailbox) getLiteralForSection(itemSection imap.FetchItem, msg *ima
|
||||
section, err := imap.ParseBodySectionName(itemSection)
|
||||
if err != nil {
|
||||
log.WithError(err).Warn("Failed to parse body section name; part will be skipped")
|
||||
return nil //nolint[nilerr] ignore error
|
||||
return nil //nolint:nilerr ignore error
|
||||
}
|
||||
|
||||
var literal imap.Literal
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
@ -70,7 +70,7 @@ func (im *imapMailbox) updateMessagesFlags(uid bool, seqSet *imap.SeqSet, operat
|
||||
// to set flags passed as an argument and unset the rest. For example,
|
||||
// if message is not read, is flagged and is not deleted, call FLAGS \Seen
|
||||
// should flag message as read, unflagged and keep undeleted.
|
||||
func (im *imapMailbox) setFlags(messageIDs, flags []string) error { //nolint
|
||||
func (im *imapMailbox) setFlags(messageIDs, flags []string) error { //nolint:funlen
|
||||
seen := false
|
||||
flagged := false
|
||||
deleted := false
|
||||
@ -137,7 +137,7 @@ func (im *imapMailbox) setFlags(messageIDs, flags []string) error { //nolint
|
||||
return nil
|
||||
}
|
||||
|
||||
func (im *imapMailbox) addOrRemoveFlags(operation imap.FlagsOp, messageIDs, flags []string) error { //nolint[funlen]
|
||||
func (im *imapMailbox) addOrRemoveFlags(operation imap.FlagsOp, messageIDs, flags []string) error { //nolint:funlen
|
||||
for _, f := range flags {
|
||||
// Adding flag 'nojunk' is equivalent to removing flag 'junk'
|
||||
if (operation == imap.AddFlags) && (f == "nojunk") {
|
||||
@ -147,7 +147,7 @@ func (im *imapMailbox) addOrRemoveFlags(operation imap.FlagsOp, messageIDs, flag
|
||||
|
||||
switch f {
|
||||
case imap.SeenFlag:
|
||||
switch operation { //nolint[exhaustive] imap.SetFlags is processed by im.setFlags
|
||||
switch operation { //nolint:exhaustive // imap.SetFlags is processed by im.setFlags
|
||||
case imap.AddFlags:
|
||||
if err := im.storeMailbox.MarkMessagesRead(messageIDs); err != nil {
|
||||
return err
|
||||
@ -158,7 +158,7 @@ func (im *imapMailbox) addOrRemoveFlags(operation imap.FlagsOp, messageIDs, flag
|
||||
}
|
||||
}
|
||||
case imap.FlaggedFlag:
|
||||
switch operation { //nolint[exhaustive] imap.SetFlag is processed by im.setFlags
|
||||
switch operation { //nolint:exhaustive // imap.SetFlag is processed by im.setFlags
|
||||
case imap.AddFlags:
|
||||
if err := im.storeMailbox.MarkMessagesStarred(messageIDs); err != nil {
|
||||
return err
|
||||
@ -169,7 +169,7 @@ func (im *imapMailbox) addOrRemoveFlags(operation imap.FlagsOp, messageIDs, flag
|
||||
}
|
||||
}
|
||||
case imap.DeletedFlag:
|
||||
switch operation { //nolint[exhaustive] imap.SetFlag is processed by im.setFlags
|
||||
switch operation { //nolint:exhaustive // imap.SetFlag is processed by im.setFlags
|
||||
case imap.AddFlags:
|
||||
if err := im.storeMailbox.MarkMessagesDeleted(messageIDs); err != nil {
|
||||
return err
|
||||
@ -187,7 +187,7 @@ func (im *imapMailbox) addOrRemoveFlags(operation imap.FlagsOp, messageIDs, flag
|
||||
return err
|
||||
}
|
||||
// Handle custom junk flags for Apple Mail and Thunderbird.
|
||||
switch operation { //nolint[exhaustive] imap.SetFlag is processed by im.setFlags
|
||||
switch operation { //nolint:exhaustive // imap.SetFlag is processed by im.setFlags
|
||||
// No label removal is necessary because Spam and Inbox are both exclusive labels so the backend
|
||||
// will automatically take care of label removal.
|
||||
case imap.AddFlags:
|
||||
@ -257,7 +257,7 @@ func (im *imapMailbox) moveMessages(uid bool, seqSet *imap.SeqSet, targetLabel s
|
||||
return im.labelMessages(uid, seqSet, targetLabel, true)
|
||||
}
|
||||
|
||||
func (im *imapMailbox) labelMessages(uid bool, seqSet *imap.SeqSet, targetLabel string, move bool) error { //nolint[funlen]
|
||||
func (im *imapMailbox) labelMessages(uid bool, seqSet *imap.SeqSet, targetLabel string, move bool) error { //nolint:funlen
|
||||
messageIDs, err := im.apiIDsFromSeqSet(uid, seqSet)
|
||||
if err != nil || len(messageIDs) == 0 {
|
||||
return err
|
||||
@ -332,7 +332,7 @@ func (im *imapMailbox) labelMessages(uid bool, seqSet *imap.SeqSet, targetLabel
|
||||
|
||||
// SearchMessages searches messages. The returned list must contain UIDs if
|
||||
// uid is set to true, or sequence numbers otherwise.
|
||||
func (im *imapMailbox) SearchMessages(isUID bool, criteria *imap.SearchCriteria) (ids []uint32, err error) { //nolint[gocyclo]
|
||||
func (im *imapMailbox) SearchMessages(isUID bool, criteria *imap.SearchCriteria) (ids []uint32, err error) { //nolint:gocyclo,funlen
|
||||
// Called from go-imap in goroutines - we need to handle panics for each function.
|
||||
defer im.panicHandler.HandlePanic()
|
||||
|
||||
@ -524,7 +524,7 @@ func (im *imapMailbox) ListMessages(isUID bool, seqSet *imap.SeqSet, items []ima
|
||||
}, "FETCH", isUID, seqSet, items)
|
||||
}
|
||||
|
||||
func (im *imapMailbox) listMessages(isUID bool, seqSet *imap.SeqSet, items []imap.FetchItem, msgResponse chan<- *imap.Message) (err error) { //nolint[funlen]
|
||||
func (im *imapMailbox) listMessages(isUID bool, seqSet *imap.SeqSet, items []imap.FetchItem, msgResponse chan<- *imap.Message) (err error) { //nolint:funlen
|
||||
defer func() {
|
||||
close(msgResponse)
|
||||
if err != nil {
|
||||
@ -560,7 +560,7 @@ func (im *imapMailbox) listMessages(isUID bool, seqSet *imap.SeqSet, items []ima
|
||||
}
|
||||
|
||||
processCallback := func(value interface{}) (interface{}, error) {
|
||||
apiID := value.(string) //nolint[forcetypeassert] we want to panic here
|
||||
apiID := value.(string) //nolint:forcetypeassert // we want to panic here
|
||||
|
||||
storeMessage, err := im.storeMailbox.GetMessage(apiID)
|
||||
if err != nil {
|
||||
@ -594,7 +594,7 @@ func (im *imapMailbox) listMessages(isUID bool, seqSet *imap.SeqSet, items []ima
|
||||
}
|
||||
|
||||
collectCallback := func(idx int, value interface{}) error {
|
||||
msg := value.(*imap.Message) //nolint[forcetypeassert] we want to panic here
|
||||
msg := value.(*imap.Message) //nolint:forcetypeassert // we want to panic here
|
||||
msgResponse <- msg
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
@ -87,8 +87,8 @@ func newGoIMAPServer(tls *tls.Config, backend backend.Backend, address string, u
|
||||
server.Addr = address
|
||||
|
||||
serverID := imapid.ID{
|
||||
imapid.FieldName: "ProtonMail Bridge",
|
||||
imapid.FieldVendor: "Proton Technologies AG",
|
||||
imapid.FieldName: "Proton Mail Bridge",
|
||||
imapid.FieldVendor: "Proton AG",
|
||||
imapid.FieldSupportURL: "https://protonmail.com/support",
|
||||
}
|
||||
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
@ -124,7 +124,7 @@ func (s *storeUserWrap) GetAddress(addressID string) (storeAddressProvider, erro
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return newStoreAddressWrap(address), nil //nolint[typecheck] missing methods are inherited
|
||||
return newStoreAddressWrap(address), nil //nolint:typecheck missing methods are inherited
|
||||
}
|
||||
|
||||
type storeAddressWrap struct {
|
||||
@ -138,7 +138,7 @@ func newStoreAddressWrap(address *store.Address) *storeAddressWrap {
|
||||
func (s *storeAddressWrap) ListMailboxes() []storeMailboxProvider {
|
||||
mailboxes := []storeMailboxProvider{}
|
||||
for _, mailbox := range s.Address.ListMailboxes() {
|
||||
mailboxes = append(mailboxes, newStoreMailboxWrap(mailbox)) //nolint[typecheck] missing methods are inherited
|
||||
mailboxes = append(mailboxes, newStoreMailboxWrap(mailbox)) //nolint:typecheck missing methods are inherited
|
||||
}
|
||||
return mailboxes
|
||||
}
|
||||
@ -148,7 +148,7 @@ func (s *storeAddressWrap) GetMailbox(name string) (storeMailboxProvider, error)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return newStoreMailboxWrap(mailbox), nil //nolint[typecheck] missing methods are inherited
|
||||
return newStoreMailboxWrap(mailbox), nil //nolint:typecheck missing methods are inherited
|
||||
}
|
||||
|
||||
type storeMailboxWrap struct {
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Package uidplus DOES NOT implement full RFC4315!
|
||||
//
|
||||
@ -30,7 +30,6 @@ import (
|
||||
|
||||
"github.com/emersion/go-imap"
|
||||
"github.com/emersion/go-imap/server"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Capability extension identifier.
|
||||
@ -43,8 +42,6 @@ const (
|
||||
appendSucess = "APPEND completed"
|
||||
)
|
||||
|
||||
var log = logrus.WithField("pkg", "imap/uidplus") //nolint[gochecknoglobals]
|
||||
|
||||
// OrderedSeq to remember Seq in order they are added.
|
||||
// We didn't find any restriction in RFC that server must respond with ranges
|
||||
// so we decided to always do explicit list. This makes sure that no dynamic
|
||||
@ -155,7 +152,7 @@ func (e *UIDExpunge) Handle(conn server.Conn) error {
|
||||
return mailbox.Expunge()
|
||||
}
|
||||
|
||||
func (e *UIDExpunge) UidHandle(conn server.Conn) error { //nolint[golint]
|
||||
func (e *UIDExpunge) UidHandle(conn server.Conn) error { //nolint:revive,stylecheck
|
||||
if e.SeqSet == nil {
|
||||
return errors.New("missing sequence set")
|
||||
}
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package uidplus
|
||||
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package imap
|
||||
|
||||
@ -27,10 +27,6 @@ import (
|
||||
goIMAPBackend "github.com/emersion/go-imap/backend"
|
||||
)
|
||||
|
||||
var (
|
||||
errNoSuchMailbox = errors.New("no such mailbox") //nolint[gochecknoglobals]
|
||||
)
|
||||
|
||||
type imapUser struct {
|
||||
panicHandler panicHandler
|
||||
backend *imapBackend
|
||||
@ -147,7 +143,7 @@ func (iu *imapUser) ListMailboxes(showOnlySubcribed bool) ([]goIMAPBackend.Mailb
|
||||
return mailboxes, nil
|
||||
}
|
||||
|
||||
// GetMailbox returns a mailbox. If it doesn't exist, it returns ErrNoSuchMailbox.
|
||||
// GetMailbox returns a mailbox.
|
||||
func (iu *imapUser) GetMailbox(name string) (mb goIMAPBackend.Mailbox, err error) {
|
||||
// Called from go-imap in goroutines - we need to handle panics for each function.
|
||||
defer iu.panicHandler.HandlePanic()
|
||||
|
||||
Reference in New Issue
Block a user