Mail.app: IMAP Folders not updating?
January 2nd, 2008 by Jonathan JohnsonEver since switching to Leopard, Mail.app sometimes doesn’t update folders with new messages, even if the messages added to those folders are a result of rules in Mail.app. I searched, and found partial solutions to my liking, but here’s what I settled on.
In Script Editor, save this script somewhere:
on run tell application "System Events" if exists (application processes whose name is "Mail") then tell application "Mail" set everyIMAPAccount to every imap account repeat with eachIMAPAccount in everyIMAPAccount tell eachIMAPAccount synchronize with eachIMAPAccount end tell end repeat end tell end if end tell end run
Next, add a new rule to Mail.app that has the condition “Any Message,” and the action “Run Applescript” using this AppleScript. All this script does is automatically run “Synchronize” on each account any time a new message is found. This ensures that all folders are kept up to date.
I’ve been using this solution for a week now, and it’s been a godsend.
Edit:
See comments for a much simpler script.
January 2nd, 2008 at 10:29 pm
Seems to me to be a lot like Regularly synchronize IMAP folders in Mail…
Also, the AppleScript can be a lot nicer:
January 2nd, 2008 at 10:37 pm
Wow Joe, that is a lot nicer. I should take some of the blame for that ugly entanglement of ends — I suggested he “simplify” the code into a single function. I don’t think any of us has as much AppleScript experience as you, though.
January 3rd, 2008 at 7:13 am
Thanks Joe. It is indeed a lot like it, but I was aiming for synchronizing every account. The problem with most of the other solutions was that they either required a script per account or weren’t designed to be run from inside of a rule. I didn’t really write my script per-say, I came to it by simplifying/changing another complicated script
I blame the original author 
July 7th, 2008 at 1:18 pm
Thanks! This has been driving me nuts ever since switching to leopard. I even switched to Thunderbird (eww) for awhile.