Problem with emacs rmail

Reading mail with emacs rmail is a "special" way of editing your RMAIL file. As with other files you edit with emacs, it keeps a backup copy, called RMAIL.BAK (with emacs 18) or RMAIL~ (with emacs 19).

When reading mail, emacs takes the mail spooled for you (in /var/mail) and moves it to .newmail in your home directory. It then appends it to your RMAIL buffer, saves it to disk, and deletes the .newmail file. When the save fails, emacs does not delete .newmail, as it knows that is the only copy of your mail on disk.

Now, the next time you read your mail, emacs sees there already is a .newmail, so instead of moving any spooled mail into .newmail, it rereads that. It continues to do this until it successfully saves the RMAIL buffer with the new mail appended. (So you see the same message(s) over and over.) While you repetitvely read the .newmail file, new mail may be accumulating in the spool directory. Though emacs will not read the spooled new mail until the .newmail file is appended and saved successfully, there is no fear that the spooled new mail is "lost."

Since emacs needs about three times the disk space occupied by your RMAIL file (the backup, the current copy, and the space to write a new copy to disk) in order to continue reading mail, you should try to keep your RMAIL file as small as possible. Move messages you want to keep to another file.

Should you find yourself already in this situation, this is what you can do:

  1. Delete all the messages you don't need in your RMAIL buffer and type "s". (This will expunge those messages and try to save your RMAIL buffer to disk.) If this save succeeds, skip to "SUCCESS" below.
  2. Get out of emacs and delete your RMAIL.BAK (or RMAIL~) file, then try to save your RMAIL buffer again.. Assuming you had enough space to read your mail the first time, this should make enough space to save your mail again. If this save succeeds, skip to "SUCCESS" below.
  3. Should the above not free up enough space, you can either look for other files to delete to make space (~, .BAK, core files, or .ps or .dvi files which can be regenerated are good targets). Then try to save your RMAIL buffer again.
  4. SUCCESS: Once you've successfully saved your RMAIL buffer, you should delete the .newmail file, since you don't want to read that yet again.
  5. FAILURE? If you've tried all this and still can't get enough space, it's time to go to the sysadmin or operator for help. Don't just keep reading the same messages over and over, as it then takes more and more space to store multiple copies.