Skip to content

Commit

Permalink
Merge support for SPECIAL-USE extension
Browse files Browse the repository at this point in the history
  • Loading branch information
foxcpp authored and emersion committed Nov 1, 2020
1 parent 8011154 commit 3e25bca
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ includes:

* [LITERAL+](https://tools.ietf.org/html/rfc7888)
* [SASL-IR](https://tools.ietf.org/html/rfc4959)
* [SPECIAL-USE](https://tools.ietf.org/html/rfc6154)

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

Expand All @@ -156,7 +157,6 @@ to learn how to use them.
* [NAMESPACE](https://github.com/foxcpp/go-imap-namespace)
* [QUOTA](https://github.com/emersion/go-imap-quota)
* [SORT and THREAD](https://github.com/emersion/go-imap-sortthread)
* [SPECIAL-USE](https://github.com/emersion/go-imap-specialuse)
* [UNSELECT](https://github.com/emersion/go-imap-unselect)
* [UIDPLUS](https://github.com/emersion/go-imap-uidplus)

Expand Down
20 changes: 20 additions & 0 deletions mailbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ const (
UnmarkedAttr = "\\Unmarked"
)

// Mailbox attributes defined in RFC 6154 section 2 (SPECIAL-USE extension).
const (
// This mailbox presents all messages in the user's message store.
AllAttr = "\\All"
// This mailbox is used to archive messages.
ArchiveAttr = "\\Archive"
// This mailbox is used to hold draft messages -- typically, messages that are
// being composed but have not yet been sent.
DraftsAttr = "\\Drafts"
// This mailbox presents all messages marked in some way as "important".
FlaggedAttr = "\\Flagged"
// This mailbox is where messages deemed to be junk mail are held.
JunkAttr = "\\Junk"
// This mailbox is used to hold copies of messages that have been sent.
SentAttr = "\\Sent"
// This mailbox is used to hold messages that have been deleted or marked for
// deletion.
TrashAttr = "\\Trash"
)

// Basic mailbox info.
type MailboxInfo struct {
// The mailbox attributes.
Expand Down
1 change: 0 additions & 1 deletion message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,6 @@ func TestEmptyAddressList(t *testing.T) {
}
}


var paramsListTest = []struct {
fields []interface{}
params map[string]string
Expand Down

1 comment on commit 3e25bca

@exander77
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see this being merged into go-imap.

Please sign in to comment.