MacOS X offers the wonderful keychain to simplify login to sites, servers and applications needing passwords. While this makes life a great deal easier, the keychain is prone to corruption through erroneous creation of multiple entries.
In the case of Mail.app and Entourage, both heavy keychain users, errors in your keychain will cause strange behavior. If you find any app hanging at the time a login is happening or get the Entourage error "The action could not be completed. System error occurred (-50)", it is time to repair your keychain.
Apple has created the Keychain First Aid program to help in this case, and put up a Knowledge Base article about it (where you can also download the program). Often, many strange problems will disappear once you have a properly functional keychain again.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20030204070558128