Messages will only be moved to junk if you use the "Move it to the Junk mailbox" setting in Mail preferences.