After backing up ~/Library/Mail, pull the com.apple.Mail.plist file from ~/Library/Preferences. Re-setup Mail with the appropriate incoming/outgoing servers, and then import mailboxes under the file menu to pull back in the Mail folder. Importing mailboxes only works for POP email accounts, if its IMAP there's really no point in reimporting because it'll just read through the contents of the email server.