Skip to content

Commit

Permalink
Add IDLE to capabilities list
Browse files Browse the repository at this point in the history
IDLE was changed into a built-in extension, but the default capabilities list was never updated to include it. The go-imap/client library (and probably any other sane IMAP client) resorts to polling if the IDLE cap isn't present.

Co-authored-by: sblinch <[email protected]>
Closes #453.
  • Loading branch information
foxcpp committed Jan 19, 2022
1 parent 16ffd07 commit dcd9ee6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (c *conn) Close() error {
}

func (c *conn) Capabilities() []string {
caps := []string{"IMAP4rev1", "LITERAL+", "SASL-IR", "CHILDREN", "UNSELECT", "MOVE"}
caps := []string{"IMAP4rev1", "LITERAL+", "SASL-IR", "CHILDREN", "UNSELECT", "MOVE", "IDLE"}

appendLimitSet := false
if c.ctx.State == imap.AuthenticatedState {
Expand Down
2 changes: 1 addition & 1 deletion server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// Extnesions that are always advertised by go-imap server.
const builtinExtensions = "LITERAL+ SASL-IR CHILDREN UNSELECT MOVE APPENDLIMIT"
const builtinExtensions = "LITERAL+ SASL-IR CHILDREN UNSELECT MOVE IDLE APPENDLIMIT"

func testServer(t *testing.T) (s *server.Server, conn net.Conn) {
bkd := memory.New()
Expand Down

0 comments on commit dcd9ee6

Please sign in to comment.