…this is a great way to keep your mailboxes up-to-the-second current without having Mail.app hog the bandwidth, checking every minute or five minutes.
If your server supports IDLE (Gmail, .Mac/MobileMe, and most university servers do), then the only things you need to do are:
Go into Mail » Preferences » Accounts (Advanced) and make sure that Use IDLE command if the server supports it is enabled (it’s enabled by default).
(This is the fun part) Again go into Mail » Preferences » General and set Check for new Mail to Manually.
And robg adds an important note:
If you have a mix of accounts some of which include IDLE support and some which don’t (as I do), here’s another way to set this up. For the IDLE-enabled accounts, uncheck the box next to ‘Include when automatically checking for new mail’ on the Advanced tab of that account’s settings pages. For the non-IDLE accounts, leave this box checked.
Then, in General in Mail’s Preferences, leave the ‘Check for new mail’ pop-up set to whatever time interval you prefer. This way, your IDLE-enabled email will show up as soon as the server pushes it to your machine, but you’ll still check the non-IDLE accounts on a regular basis. This works quite well for me — three of my accounts have IDLE enabled and the email just shows up, while the other two accounts are checked using Mail’s automatic checks.]
One problem, noted by EricMc, which I too have experienced is:
When using the idle support in Mail.app many people experience issues with new mail sounds or sounds triggered from scripts not playing or playing much later than expected.