I stepped away from my laptop last night and the battery ran out. When I restarted, Mail said something about restarting to fix an error. When it restarted, I got the "Welcome to Mail" screen to set up my mail accounts.
Mail has been acting funny for a bit since I've upgraded to Leopard: junk mail in my mailboxes when it should go straight to trash, incorrect unread mail count next to the folders, having problems handling attachments, etc.
I repaired permissions on the disk to no avail. Trashed the preference file too, as others have suggested, but no dice.
I have found my Mail data in user/Library/Mail and copied it to my desktop. Any ideas how to fix it? I'm terrified of not being able to access about 7 years of email.
Many thanks!