User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:126.96.36.199) Gecko/20100914 Firefox/3.6.10 Build Identifier: First to address the obvious objection, new messages in the junk folder don't yield alerts (tray notification, new mail icon), so there will be no flood of those, no annoyance from this change. Now the rationale, mail is sometimes misclassified as junk, so it's useful to know that there is new junk (when looking at the account), in case you need to check it for an expected misclassified message. I was expecting check_all_imap_folders_for_new to be doing this already, it's not at all obvious that you have to explicitly select the junk folder on each account to see new junk messages. All should mean all, and because there are no alerts, there is really no downside. Reproducible: Always
unsure whether this is backend, and should be considered ENH
bienvenu, thoughts on comment 0?
I'm not convinced there won't be alerts, and the account will most likely get the "has new mail" flag set for just new junk mail. But I can see why you'd want to know there was new mail in the junk folder. So I think there might be some backend work that goes along with this to fix fallout. And yes, the check all folders code lives in the backend already (nsImapIncomingServer, iirc).
I'll take comment 3 as, we'd accept the right patch.