changeset 10815:52e860d10537

(rmail-retry-failure): Support a new style of failure msg.
author Richard M. Stallman <rms@gnu.org>
date Fri, 24 Feb 1995 00:10:07 +0000
parents 48bfa8e29f36
children d172fd0e356f
files lisp/mail/rmail.el
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Thu Feb 23 18:45:30 1995 +0000
+++ b/lisp/mail/rmail.el	Fri Feb 24 00:10:07 1995 +0000
@@ -2242,6 +2242,7 @@
 (defvar mail-unsent-separator
   (concat "^ *---+ +Unsent message follows +---+ *$\\|"
 	  "^ *---+ +Returned message +---+ *$\\|"
+	  "^Start of returned message$\\|"
 	  "^ *---+ +Original message +---+ *$\\|"
 	  "^ *--+ +begin message +--+ *$\\|"
 	  "^ *---+ +Original message follows +---+ *$\\|"
@@ -2281,6 +2282,23 @@
 		  (error "Cannot find end of header in failed message")))
 	  (or (re-search-forward mail-unsent-separator nil t)
 	      (error "Cannot parse this as a failure message"))
+	  (skip-chars-forward "\n")
+	  ;; Support a style of failure message in which the original
+	  ;; message is indented, and included within lines saying
+	  ;; `Start of returned message' and `End of returned message'.
+	  (if (looking-at " *Received:")
+	      (let (column)
+		(skip-chars-forward " ")
+		(setq column (current-column))
+		(let ((old-buffer (current-buffer)))
+		  (set-buffer (get-buffer-create " rmail retry temp"))
+		  (insert-buffer old-buffer)
+		  (goto-char (point-max))
+		  (if (re-search-backward "^End of returned message$")
+		      (delete-region (point) (point-max)))
+		  (indent-rigidly (point-min) (point-max) (- column))
+		  (goto-char (point-min))
+		  (re-search-forward mail-unsent-separator nil t))))
 	  (save-restriction
 	    (let ((old-end (point-max)))
 	      ;; One message contained a few random lines before the old