Trouble is, there can be such a variety of causes for this, & I hasve seen a few cures, as well as many giving up without a cure.
To find out if it's system wide or user specific, try this...
Open System Preferences>Accounts, unlock the lock, click on the little plus icon, make a new admin account, log out & into the new account.
Setup one new Mail account at least that has that problem.
Does Mail work in the new account?
Thank you, no one has suggested that before.
I created a new admin and set up one of the problem Mail accounts - I got the same error message:
"There may be a problem with the mail server or network. Verify the settings for account “xxxxx” or try again.
The server returned the error: The attempt to send data to the server “(null)” failed."
This happens frequently and consistently on this one Mail account.
This happens only on my laptop - this account works fine on my iPhone, iPad, Mac Mini, iBook and PC laptop.
I can login to webmail and access the mailbox with no problem as well.
It consistently fails to login. What normally happens is when Mail fails to login to the account, it takes that mail box offline. I then double click on the mail box to take it back online and allow Mail to try again at the next scheduled time (at which point it may fail or succeed it's totally random).
I do log in on different networks and it happens there as well.
When I was working with my hosting service, we reset my Airport several times, created new networks, as well as replaced my cable modem.
Make a New Location, Using network locations in Mac OS X ...
The Interface that connects to the Internet, needs to be drug to the top of System Preferences>Network>Show:>Network Port Configurations and checked ON.
System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
The interface that connects to the Internet should be dragged to the top of the list.
Interesting. I'll try it. Also, anyone noticed patterns?
It happens more often when waking from sleep or when logging in after an absence of several hours. This is not to say it does not "forget" my password other times, just that it seems to happen regularly under these circumstances.
Also, has anyone just ignored the "Password for Account" window when it pops up, canceled it, and then clicked "Get Mail". This generally works for me.
Which seems to indicate that the password is correct and is apparently available to iCloud or the system software except for random fail.
I use iPhone 4S and iPad2 also and do not have the problem there. Nor do I have a problem accessing my mail at the iCloud web site. Only on my iMac 10.7.3 is there this difficulty. Interesting puzzle.