Mac Mail.app accounts offline after working hours

Couldn't you just set Mail.app to check only specific accounts, then re-enable them when you want to check them? In the Advanced options under Accounts, you can uncheck the box to Include when automatically checking for new messages. If this box is unchecked, this account will be ignored when Mail.app checks for new email.

enter image description here

The checking/unchecking of this box can be scripted using AppleScript.

tell application "Mail"
   set enabled of account "NameOfAccount" to false
end tell

This script can then be tied to a macro in an application such as Keyboard Maestro.


Try my script. It uses launchd job to invalidate user name of selected accounts so it will fail to connect to the mail server when Mail.app decides to bring itself online.

https://embswit.wordpress.com/2017/11/19/i-dont-want-to-see-new-emails-in-the-morning-macos