diff --git a/imapclient/client.go b/imapclient/client.go index b0ab0869..e1709735 100644 --- a/imapclient/client.go +++ b/imapclient/client.go @@ -956,7 +956,9 @@ func (c *Client) Delete(mailbox string) *Command { } // Rename sends a RENAME command. -func (c *Client) Rename(mailbox, newName string) *Command { +// +// A nil options pointer is equivalent to a zero options value. +func (c *Client) Rename(mailbox, newName string, options *imap.RenameOptions) *Command { cmd := &Command{} enc := c.beginCommand("RENAME", cmd) enc.SP().Mailbox(mailbox).SP().Mailbox(newName) diff --git a/imapserver/conn.go b/imapserver/conn.go index 56ba9e1a..e95c641c 100644 --- a/imapserver/conn.go +++ b/imapserver/conn.go @@ -352,7 +352,7 @@ func (c *Conn) handleRename(dec *imapwire.Decoder) error { if err := c.checkState(imap.ConnStateAuthenticated); err != nil { return err } - return c.session.Rename(oldName, newName) + return c.session.Rename(oldName, newName, &imap.RenameOptions{}) } func (c *Conn) handleSubscribe(dec *imapwire.Decoder) error { diff --git a/imapserver/session.go b/imapserver/session.go index 873bdefa..eb774382 100644 --- a/imapserver/session.go +++ b/imapserver/session.go @@ -58,7 +58,7 @@ type Session interface { Select(mailbox string, options *imap.SelectOptions) (*imap.SelectData, error) Create(mailbox string, options *imap.CreateOptions) error Delete(mailbox string) error - Rename(mailbox, newName string) error + Rename(mailbox, newName string, options *imap.RenameOptions) error Subscribe(mailbox string) error Unsubscribe(mailbox string) error List(w *ListWriter, ref string, patterns []string, options *imap.ListOptions) error