Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions imap/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ func defaultCommands() map[string]*CommandConfig {
"UID STORE": &CommandConfig{States: sel, Filter: FetchFilter},
"UID COPY": &CommandConfig{States: sel},

// RFC 6851
"MOVE": &CommandConfig{States: sel},
"UID MOVE": &CommandConfig{States: sel},

// RFC 2087
"SETQUOTA": &CommandConfig{States: auth, Filter: LabelFilter("QUOTA")},
"GETQUOTA": &CommandConfig{States: auth, Filter: LabelFilter("QUOTA")},
Expand Down
12 changes: 12 additions & 0 deletions imap/imap.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,12 @@ func (c *Client) Copy(seq *SeqSet, mbox string) (cmd *Command, err error) {
return c.Send("COPY", seq, c.Quote(UTF7Encode(mbox)))
}

// Move moves the specified message(s) to the end of the specified destination
// mailbox.
func (c *Client) Move(seq *SeqSet, mbox string) (cmd *Command, err error) {
return c.Send("MOVE", seq, c.Quote(UTF7Encode(mbox)))
}

// UIDSearch is identical to Search, but the numbers returned in the response
// are unique identifiers instead of message sequence numbers.
func (c *Client) UIDSearch(spec ...Field) (cmd *Command, err error) {
Expand All @@ -395,6 +401,12 @@ func (c *Client) UIDCopy(seq *SeqSet, mbox string) (cmd *Command, err error) {
return c.Send("UID COPY", seq, c.Quote(UTF7Encode(mbox)))
}

// UIDMove is identical to Move, but the seq argument is interpreted as
// containing unique identifiers instead of message sequence numbers.
func (c *Client) UIDMove(seq *SeqSet, mbox string) (cmd *Command, err error) {
return c.Send("UID MOVE", seq, c.Quote(UTF7Encode(mbox)))
}

// SetQuota changes the resource limits of the specified quota root. See RFC
// 2087 for additional information.
func (c *Client) SetQuota(root string, quota ...*Quota) (cmd *Command, err error) {
Expand Down