I'd like to create a button in Mountain Lion's Mail.app to move mail to an IMAP folder called Junk, much like the Archive button moves mail to my IMAP Archive folder. (This folder is automatically emptied on my server periodically and used to train spam filters.)
I thought perhaps I could leverage the Junk button, but that seems to require turning on the built-in filtering engine, which I do not believe I want to do. I specifically want to just move the message myself explicitly.
I'm currently using the Favorites bar, to which I've added the requisite folder, and I can either drag messages there or use the keyboard shortcut (e.g. command–control–4, since it's the fourth folder on my bar—unfortunately, I find such a combo awkward to press), but I'd really prefer a button I could stick on the toolbar.
Best Answer
You can do this exactly by "customizing" the action that the "Junk" button performs:
Mail Menu> Preferences> Junk Mail tab>
When Junk Mail Arrives: select Perform Custom actions (Click Advanced to configure)
Then, click Advanced button in lower center of Pref Pane, next to Reset
This allows you to create a custom Rule, essentialy, just like other Rules, in the "Rules" Preference Pane, but it activates when you click the "Junk" button or when Mail thinks it found something that is Junk (keep reading to limit automatic Junk Mail filtering).
The rule I would suggest is:
That's most of it. Additional tips/possibilities:
To become master of your Junk Mail 'Smart Filter':
~/Library/Mail/V2/MailData
and does not appear to be hidden
Cleaning out temporary files is a secondary fallback, like running the Unix 'cron' Daily/Monthly/Weekly scripts, etc. There are many programs out there that can do this from the normal interface without command line etc, and there are many more cache files out there too. My favorite is Cocktail.
If you can't find the LSMMAP2 file, just use the Junk Mail button for a little while, then come back and look for it again. Since, if you reset it, it may have been deleted.