How can I edit the mailbox manually

I use gmail to POP my account because of the spamfilter. From time to time I receive an error message
"Connection timed out: There may be a problem with the settings you added. Ple..." after this I am no longer able to retrieve my mails because of the blocked session: "[IN-USE] /var/spool/mail/.xxx.xxx.pop lock busy! Is another session ac..."
I delete the account on gmail and wait a while (few hours) after which I reconfigure the client account. Sometimes it works for 200 mails than the same story again but most of the time I recieve the first message "Connection timed out: There may be a problem with the settings you added. Ple...".
I am the only user, it's a dedicated server. How can I edit the mailbox manually (for example through vi) so that I can look for corrupted lines, problems etc and how can I identify and kill the active session. I am familiarized with telnet, shell and some unix/linux commands and I have read some chapters about sendmail etc :o Thank you for your help in advance

It looks more like you have session termination problems than anything else or that you are opening mail from multiple computers. If the former I would suggest that you simply remove /var/spool/mail/.xxx.xxx.pop (instead of recreating the account) and in the latter case I would suggest that you simply forward your mail to gmail instead of collecting it through pop or that you switch to another collection method such as a client with good spam filtering and use your mail server directly.