RemoteGoodTraining with Exchange server

I’m getting a strange error message when running the RemoteGoodTraining with an exchange server:

error “Mail got an error: Can’t set mailbox “INBOX” of account “Wesleyan” to mailbox “INBOX” of account \”MyAccount”." number -10006 from mailbox “INBOX” of account “MyAccount”

The line it’s tripping up on is:
set _message’s mailbox to mailbox “INBOX” of account “MyAccount"

Any tips? It works on my other IMAP (non exchange) accounts.

Although Mail always shows the inbox as “Inbox”, scripts must target the internal names of the mailboxes, as set on the server. Usually this is “INBOX”, but (especially for Exchange) it might be something else like “Inbox” or a localized name such as “innboks”, “Posteingang”, or “Boite de reception”. If you run this script:

tell application "Mail"
    get name of every mailbox of account "MyAccount"
end tell

Mail will show you the names of the mailboxes. You can then find the name of the inbox and use it in your remote training script in place of “INBOX”.

The new Apple Mail - Remote Training script incorporates support for different inbox names.