Computing Topics --> Computer Problems and Questions --> Email Related Problems --> Leftover Pine, Mozilla Lock Files -->

Leftover Pine, Mozilla Lock Files

When encountering locked files, the user has either left open a Pine session on another terminal, or is using an offline mail client (Thunderbird, Outlook Express, etc.) and is trying to read mail while the other program has control over the mail files.

If in the current Pine session the "readonly" message shows, the user needs to get out of Pine and determine if the culprit is actually another mail session or simply the lock file from a previous mail session which was not properly removed.

Note: You have to be careful when doing this; removing a lock file for an active mail session could cause mail file(s) to get corrupted, possibly losing some mail items in the process!

The first step is to determine if a lock file exists. Type

  1. cd /mail/$user and hit enter.
  2. ls -al and hit enter.

    A lock file from a Pine session begins with a dot (".") and is followed by seven characters.

            .6700300
       
    

    A lock file from an offline mail client is a longer string, usually containing the word "lock" as well as the word "imap" (part of the host name of the IMAP server which the mail connection came in through.

            mbox.lock.954921580.25647.imap0.wam.umd.edu
       

    Note: There is no leading dot (".") on this latter type of lock file.

  3. If you discover one (or more) of these types of files, the next thing to determine is whether it's from a current or old (defunct) mail session.

  4. If you have determined that the lock files are from an old session, then follow these steps:

    • Note: If you don't know which directory you are supposed to be in, then type cd /mail/$user
      To remove the lock files, you can use the wildcard "*". Type
      rm mbox.lock.*
    • To remove the pine lock files. Type rm .lockfile name. In this example, you can use the wildcard "*".
      rm .6*
How do I:
How are we doing? Comments on this page?
Office of Information Technology
Office of Information Technology University of Maryland