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


Click here to return to the 'Regularly synchronize IMAP folders in Mail' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Regularly synchronize IMAP folders in Mail
Authored by: allanmarcus on Jan 20, '05 02:30:28PM

Silly me, I just wrote this same thing last week! The reason is that our IMAP server has rules, and filters mail on the server. This turns out to be great since all my mail is filtered, even if I'm not at my mac (we have web mail too).

So, here's my take on the app. I have a cron job that runs this script every 5 minutes. This script checks to see if Mail is running.

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

Cron job:
0,10,20,30,40,50	*	*	*	*	/usr/bin/osascript /Users/allan/Documents/AppleScipts/SyncMail.scpt


[ Reply to This | # ]