Automatically mark Junk mail as read

I've enabled the builtin Mail rules to move junk mail directly to the junk folder. But the messages do not get marked as read, so they are shown/counted as unread in the Mail sidebar.

How can I mark mail that goes to Junk and Trash folders as read automatically?

enter image description here


Solution 1:

For Junk Mail, you can create a Rule. From the menu bar item “Mail”, select > Preferences > Rules > Add Rule. Make a rule with the following conditions:

enter image description here

For Trash, you can simply bypass Mail’s Trash and rely on the server settings of the email account. To do so, from the “Mail” menu bar item (again) > Preferences > Accounts > [select account] > Mailbox Behaviors > uncheck “Move Deleted Messages To the Trash Mailbox”

Solution 2:

Unfortunately the short answer here is likely to be; you can't.

To understand why, it's important to note that are two places where your junk mail will be filtered out.

Client Side Filtering

The settings you are looking at in Mail are for client-side junk mail filtering, this means that as messages are downloaded from your e-mail provider, Mail will attempt to identify if any are spam, and move them to your Junk mailbox(es).

Messages being filtered in this way should be marked as read if that's the behaviour you have configured under your Junk settings.

Client side filtering often gives you the most flexible control, but the downside is that settings will be specific only to your mail client (Mail.app), so if you access your e-mail on another device, your junk mail may still arrive directly into your inbox.

Server Side Filtering

The other place that junk mail filtering may occur is on your e-mail provider's own mail servers; these will attempt to identify junk and delete or filter it before it is downloaded into Mail. This can be great if properly configured, as it will be consistent across all devices, and usually requires no extra configuration.

However the downside to this is that junk mail filtered by your mail server won't normally be processed by client-side rules, so if the messages aren't marked as read by your server, they won't be marked as read by Mail.app, and at time of writing there is still no way to define a rule that can override this (as Mail does not allow rules to trigger only for messages in a certain mailbox).

Some e-mail providers don't mark junk mail as read by default, and provide no means of customising the behaviour. The most common example I'm aware of (and personally aggravated by) is Microsoft's Outlook 365 (previously Hotmail) service. Even though it offers server-side rules, these don't allow any control of automatically filtered junk mail, so they remain marked as read, despite many, many requests by many, many people to change this.

Conclusion

Unless your mail provider offers you some way to customise server-side filtering behaviour (usually through a webmail interface), then you may be stuck.

However, if the main annoyance for you is that Mail is counting unread junk on its icon, you can change this at least by creating a new Smart Mailbox (Mailbox -> New Smart Mailbox) then create a rule that looks like the following:

enter image description here

Basically you want to match all unread messages, except those in certain mailboxes (in our case Junk), Trash and Sent should already be excluded by default.

Now, under Mail -> Preferences in the General tab, change "Dock Unread Count" to your new smart mailbox, the Mail.app icon now will only show a count of unread messages excluding your junk folder. You can also use a smart mailbox to customise notification behaviour in much the same way.