Closed ross-williams closed 8 years ago
You can only specify mailbox flags if your server supports the CREATE-SPECIAL-USE
capability (see https://tools.ietf.org/html/rfc6154#section-3). In this case, it would be possible to implement a CreateWithUses(name string, uses []string)
func that creates a mailbox with the specified special-use flags.
Thanks very much for your reply.
I have written a Go program that uses mxk/go-imap to copy an IMAP email account to another IMAP email account and to compare two IMAP accounts. It all works fine, including the copying of message flags and the comparing of mailbox flags.
However, I can't find anything in the mxk/go-imap interface that enables me to WRITE mailbox flags. I can read them by examining mailboxinfo.attrs which I can obtain by calling func (rsp Response) MailboxInfo() MailboxInfo but I can't see anything in the interface that allows me to write them. The method func (c Client) Create(mbox string) (cmd Command, err error) does not allow me to specify a set of flags, and there seems to be no additional method to allow me to do so.
I would really appreciate some help here because this is the last missing piece for an IMAP copy program that is otherwise copying and comparing everything else in an IMAP account perfectly. The mailbox flags is the only thing it doesn't copy correctly.
Ross Williams