I'm lost on where to look in the references to accomplish this; I've tried several iterations of code and each fails. Slightly edited, but enough to get the gist...
// Make connection
imConnection, err := imap.DialTLS(strAddress, nil)
// Defer disconnect
defer func(){
imConnection.Logout(30*time.Second)
}
// Authenticate
imConnection.Login(strUname, strPass)
//Select the folder with messages I want to move
imConnection.Select(`[Gmail]\Movethese`, false)
// Create a set
set, _ = imap.NewSeqSet("1:*")
// It's my understanding that moving messages means copying them over, then
// deleting the original messages?
cmd, _ := imConnection.UIDCopy(set, `[Gmail]\Destination`)
This seems to silently fail. This to me looked like it should select everything in the "Movethese" folder and copy them to "Destination." What am I missing in properly copying them over? Is there a simple way to move individual messages that match a certain subject line string?
Also I wasn't sure if the source directory would have to be set to False for R/W when selected, but it doesn't seem to make a difference.
This is importing the github.com/mxk/go-imap/imap package