Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Improve IMAP folder support in Mail.app Apps
For a long time, I have had an issue in Mail.app where it would not check for new messages in subfolders of the INBOX on my IMAP accounts. I typically have server-side rules that filter mail into various folders, and the only way to see if mail had arrived in those folders was to actually go click on the folder and wait for it to sync.

In order to fix this problem, I wrote a free bundle for Mail.app called IMAPCheck that changes the way it checks for new mail in IMAP accounts. Now, instead of just checking the INBOX for new headers, it actually does a full sync every time. This allows me to get new mail notifications automatically, the way it should be. More information on the bundle is available via the above link.

[robg adds: I haven't tested this one, but please note the caution on the author's page: Note that this could increase the amount of traffic going between you and your IMAP server significantly. I've marked the hint 10.4-only, as that's all that the bundle has been tested against; if you try it on an earlier release and it works, please post a comment to that effect.]
    •    
  • Currently 2.75 / 5
  You rated: 5 / 5 (4 votes cast)
 
[18,374 views]  

10.4: Improve IMAP folder support in Mail.app | 10 comments | Create New Account
Click here to return to the '10.4: Improve IMAP folder support in Mail.app' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Improve IMAP folder support in Mail.app
Authored by: kaw_in_stl. on Dec 15, '06 07:57:09AM

Anyone know if this is similar to "phantom" drafts appearing in the system wide draft folder? I recently switched to IMAP and didn't observe the behavior before. Basically, if I compose and send a message from the IMAP account, the draft folder shows two copies, and then if I click send, it shows the draft folder having one in there (for up to a minute or so). If I click the "get mail" button, it dissapears...



[ Reply to This | # ]
10.4: Improve IMAP folder support in Mail.app
Authored by: Skurfer on Dec 15, '06 08:28:04AM

I think this happens because there are messages in the Drafts folder that are "marked for deletion" but haven't actually been removed yet. Mail doesn't display messages that are marked for deletion in the index, so it looks like the "unread" count and the message index don't match, when they actually do.

I'm sure there are numerous ways to fix this on Apple's part. Personally, I think draft messages should be marked as "read" when they're created. In the meantime, you can make the unread count go away by selecting the Drafts folder and hitting ⌘K (which is the shortcut for Erase Deleted Messages).



[ Reply to This | # ]
10.4: Improve IMAP folder support in Mail.app
Authored by: kaw_in_stl. on Dec 18, '06 08:25:08AM

Thanks. I figured it was just an unknown "feature" (bug)!

K



[ Reply to This | # ]
10.4: Improve IMAP folder support in Mail.app
Authored by: jaysoffian on Dec 15, '06 11:41:01AM
I've been using this Applescript for ages to do the same thing:

on checkMail()
	tell application "Mail"
		if (background activity count is not 0) then return
		set everyIMAPAccount to every imap account
		repeat with eachIMAPAccount in everyIMAPAccount
			tell eachIMAPAccount
				-- cycle online status of each enabled and online account, causing mail to update the status for each folder
				if (enabled and include when getting new mail) then
					set include when getting new mail to false
					set include when getting new mail to true
				end if
			end tell
		end repeat
	end tell
end checkMail

on run
	tell application "System Events"
		if exists (application processes whose name is "Mail") then my checkMail()
	end tell
end run

on idle
	delay 120
	tell application "System Events"
		if not (exists (application processes whose name is "Finder")) then quit
		if exists (application processes whose name is "Mail") then my checkMail()
	end tell
	return 0
end idle
Save that as an Application Bundle in script editor and just set it as a login item. Tastes great, less filling (well, less mucking with Mail.app anyway...).

[ Reply to This | # ]
10.4: Improve IMAP folder support in Mail.app
Authored by: alex_kac on Dec 18, '06 03:22:45PM

I used to use this too, but I have having yet another process sit there and run like this. It just seems like a waste of CPU.



[ Reply to This | # ]
10.4: Improve IMAP folder support in Mail.app
Authored by: allanmarcus on Dec 15, '06 02:16:57PM

Here's my AppleScript, saved as a script:

tell application "System Events"
if exists process "Mail" then
try
tell application "Mail"
set everyIMAPAccount to every imap account
repeat with eachAccount in everyIMAPAccount
if enabled of eachAccount then
set theAccountToSynchronize to eachAccount
synchronize with theAccountToSynchronize
end if
end repeat
end tell
end try
end if
end tell

I think have the following crontab job:

0,10,20,30,40,50 8,9,10,11,12,13,14,15,16,17 * * 1,2,3,4,5 /usr/bin/osascript /Users/allan/Documents/AppleScipts/SyncMail.scpt


Every ten minutes on weekdays between 8 and 5 check my mail.



[ Reply to This | # ]
10.4: Improve IMAP folder support in Mail.app
Authored by: rong on Dec 16, '06 08:54:35AM

I suppose for some reason "Automatically synchronize changed mailboxes" under Mail:Preferences:Accounts doesn't work for y'all?

It works fine for me. Keeping not only the Inbox but all sub-folders 100% up to date with changes made at the server (OS X Server 10.4.x).



[ Reply to This | # ]
10.4: Improve IMAP folder support in Mail.app
Authored by: alex_kac on Dec 18, '06 03:23:50PM

Correct. That option simply does not work for me at all.



[ Reply to This | # ]
10.4: Improve IMAP folder support in Mail.app
Authored by: mahakali on Feb 19, '07 10:16:53AM
If your IMAP server support IMAP IDLE, you can use IMAP IDLE Plugin.

[ Reply to This | # ]
10.4: Improve IMAP folder support in Mail.app
Authored by: zebrum on Mar 06, '07 06:22:57AM

Some people have rules set up on their exchange server to put email into certain subfolders under the inbox. They would have configured these from Outlook and usually its a rule to put email from certain people into certain folders. The annoying thing about this is when you receive a new email which appears in a subfolder of the inbox, the Mail icon in the dock doesnt show the unread email number and you don't get a growl notification if you have growl installed.

So in this case I recommend you remove all the outlook rules, move all your subfolders out of the inbox and into a new top level folder called Archive, and then you can use Mail's smart folders to contain email from certain people. Then every so often copy all of your email from your inbox to the archive folder.

Another point to note is when you copy email or delete it from your inbox the change isn't reflected on the server until you close Mail and open it again. This is a rather strange bug because you would expect the sychronize option to do the samet thing but it doesn't.



[ Reply to This | # ]