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


Click here to return to the 'Avoid 'Working Offline' issues in Mail.app' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Avoid 'Working Offline' issues in Mail.app
Authored by: ld on Mar 02, '05 09:47:39PM

If you're anything like me and have a few alias email addresses (i.e., e.g., yahoo alias addresses which help to protect your real address) then adjusting your accounts and the script to only work with 'legit' accounts is desirable.

Step 1: Adjust your account Display Names
change your account display names so that they either end in " POP" or " IMAP" etc. Note the space before each ending. These will be used to identify legitimate from illigitimate accounts

e.g., Open Preferences > Accounts and selecct an account from the list. If you had an account called "Yahoo Mail" change its Description to "Yahoo Mail POP"

Step 2: Use the following script and then follow the steps outlined by the original poster


property LegitEndingTypes : {" POP", " IMAP"}
property IsDebug : false

my runloop()

on runloop()
	repeat
		if my isMailRunning() then my checkLegitAccounts()
		if IsDebug then exit repeat
		delay 10 * minutes
		-- change this number to how often you want to
		--check all of your accounts for new mail.
	end repeat
end runloop

on isMailRunning()
	tell application "System Events" to 
		set isMailRunning to (exists process "Mail")
	return isMailRunning
end isMailRunning

on checkLegitAccounts()
	tell application "Mail"
		repeat with anAccount in every account
			if (my isLegitAccount(name of anAccount)) then
				tell anAccount
					check for new mail for anAccount
				end tell
			end if
		end repeat
	end tell
end checkLegitAccounts

on isLegitAccount(aName)
	considering case
		repeat with aType in LegitEndingTypes
			if (aName ends with aType) then return true
		end repeat
	end considering
	return false
end isLegitAccount

---
regards,
LD

[ Reply to This | # ]