-;; "RMAIL" mail reader for Emacs.
-;; Copyright (C) 1985, 1986, 1987, 1988, 1991 Free Software Foundation, Inc.
+;;; rmail.el --- main code of "RMAIL" mail reader for Emacs.
+
+;; Maintainer: FSF
+;; Last-Modified: 24 Apr 1992
+
+;; Copyright (C) 1985, 1986, 1987, 1988, 1991, 1992 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 1, or (at your option)
+;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;; Code:
;; Souped up by shane@mit-ajax based on ideas of rlk@athena.mit.edu
;; New features include attribute and keyword support, message
(defvar rmail-last-multi-labels nil)
(defvar rmail-last-file nil)
(defvar rmail-last-rmail-file nil)
+
+;;; Regexp matching the delimiter of messages in UNIX mail format
+;;; (UNIX From lines), minus the initial ^. Note that if you change
+;;; this expression, you must change the code in rmail-nuke-pinhead-header
+;;; that knows the exact ordering of the \\( \\) subexpressions.
+(defvar rmail-unix-mail-delimiter
+ "From \\([^ \n]*\\(\\|\".*\"[^ \n]*\\)\\) ?\\([^ \n]*\\) \\([^ ]*\\) *\\([0-9]*\\) \\([0-9:]*\\)\\( ?[A-Z]?[A-Z][A-Z]T\\( DST\\)?\\| ?[-+]?[0-9][0-9][0-9][0-9]\\|\\) [0-9][0-9]\\([0-9]*\\) *\\(remote from [^\n]*\\)?\n" nil)
\f
;;;; *** Rmail Mode ***
(while files
(setq file (expand-file-name (substitute-in-file-name (car files)))
;;>> un*x specific <<
- tofile (concat file "~"))
+ ;; The "+" used to be "~", which is an extremely poor choice;
+ ;; it might accidentally be deleted when space is low
+ ;; (as happened to me!).
+ tofile (concat file "+"))
;; If getting from mail spool directory,
;; use movemail to move rather than just renaming,
;; so as to interlock with the mailer.
(rmail-nuke-pinhead-header)
(if (re-search-forward
(concat "^[\^_]?\\("
- "From [^ \n]*\\(\\|\".*\"[^ \n]*\\) ?[^ \n]* [^ \n]* *"
- "[0-9]* [0-9:]*\\( ?[A-Z]?[A-Z][A-Z]T\\| ?[-+]?[0-9][0-9][0-9][0-9]\\|\\) " ; EDT, -0500
- "[0-9]+ *\\(remote from [^\n]*\\)?$\\|"
+ rmail-unix-mail-delimiter
+ "\\|"
mmdf-delim1 "\\|"
"^BABYL OPTIONS:\\|"
"\^L\n[01],\\)") nil t)
(setq has-date (and (search-forward "\nDate:" nil t) (point)))
(goto-char start))
(let ((case-fold-search nil))
- (if (re-search-forward
- "^From \\([^ ]*\\(\\|\".*\"[^ ]*\\)\\) ?\\([^ ]*\\) \\([^ ]*\\) *\\([0-9]*\\) \\([0-9:]*\\)\\( ?[A-Z]?[A-Z][A-Z]T\\| ?[-+]?[0-9][0-9][0-9][0-9]\\|\\) [0-9][0-9]\\([0-9]*\\) *\\(remote from [^\n]*\\)?\n" nil t)
+ (if (re-search-forward (concat "^" rmail-unix-mail-delimiter) nil t)
(replace-match
(concat
"Mail-from: \\&"
""
;; If no time zone specified, assume est.
(if (= (match-beginning 7) (match-end 7))
- "Date: \\3, \\5 \\4 \\8 \\6 EST\n"
- "Date: \\3, \\5 \\4 \\8 \\6\\7\n"))
+ "Date: \\3, \\5 \\4 \\9 \\6 EST\n"
+ "Date: \\3, \\5 \\4 \\9 \\6\\7\n"))
;; Keep and reformat the sender if we don't
;; have a From: field.
(if has-from
(provide 'rmail)
+;;; rmail.el ends here