Skip to content

Commit 5316b9f

Browse files
foxcppemersion
authored andcommitted
Merge support for CHILDREN extension
1 parent 6a04343 commit 5316b9f

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ includes:
136136
* [LITERAL+](https://tools.ietf.org/html/rfc7888)
137137
* [SASL-IR](https://tools.ietf.org/html/rfc4959)
138138
* [SPECIAL-USE](https://tools.ietf.org/html/rfc6154)
139+
* [CHILDREN](https://tools.ietf.org/html/rfc3348)
139140

140141
Support for other extensions is provided via separate packages. See below.
141142

mailbox.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ const (
5858
TrashAttr = "\\Trash"
5959
)
6060

61+
// Mailbox attributes defined in RFC 3348 (CHILDREN extension)
62+
const (
63+
// The presence of this attribute indicates that the mailbox has child
64+
// mailboxes.
65+
HasChildrenAttr = "\\HasChildren"
66+
// The presence of this attribute indicates that the mailbox has no child
67+
// mailboxes.
68+
HasNoChildrenAttr = "\\HasNoChildren"
69+
)
70+
6171
// Basic mailbox info.
6272
type MailboxInfo struct {
6373
// The mailbox attributes.

server/conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (c *conn) Close() error {
163163
}
164164

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

168168
if c.ctx.State == imap.NotAuthenticatedState {
169169
if !c.IsTLS() && c.s.TLSConfig != nil {

server/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
// Extnesions that are always advertised by go-imap server.
13-
const builtinExtensions = "LITERAL+ SASL-IR"
13+
const builtinExtensions = "LITERAL+ SASL-IR CHILDREN"
1414

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

0 commit comments

Comments
 (0)