# HG changeset patch # User Richard M. Stallman # Date 716882278 0 # Node ID 8aa120c744875ed5554a924f802d0912becfcd60 # Parent adfaeccad01d4e7be6d5e571c36d902cbe3c3b55 entered into RCS diff -r adfaeccad01d -r 8aa120c74487 lisp/mail/rmail.el --- a/lisp/mail/rmail.el Sat Sep 19 01:11:21 1992 +0000 +++ b/lisp/mail/rmail.el Sat Sep 19 05:57:58 1992 +0000 @@ -528,19 +528,12 @@ ;; Delete the old files, now that babyl file is saved. (while delete-files (condition-case () - (if (or (string= (file-name-directory (car delete-files)) - rmail-spool-directory) - (string-match "^\\.newmail-" - (file-name-nondirectory (car delete-files)))) - ;; If the file's in the spool directory, try deleting. - ;; Likewise if made with movemail. - (condition-case () - (delete-file (car delete-files)) - (file-error - ;; If we can't delete it, truncate it. - (write-region (point) (point) (car delete-files)))) - ;; If not in the spool dir, just truncate it. - (write-region (point) (point) (car delete-files))) + ;; First, try deleting. + (condition-case () + (delete-file (car delete-files)) + (file-error + ;; If we can't delete it, truncate it. + (write-region (point) (point) (car delete-files)))) (file-error nil)) (setq delete-files (cdr delete-files))))) (if (= new-messages 0) @@ -597,7 +590,13 @@ ((or (file-exists-p tofile) (not (file-exists-p file))) nil) ((not movemail) - (rename-file file tofile nil)) + (rename-file file tofile nil) + ;; Make the real inbox file empty. + ;; Leaving it deleted could cause lossage + ;; because mailers often won't create the file. + (condition-case () + (write-region (point) (point) file) + (file-error nil))) (t (let ((errors nil)) (unwind-protect