diff options
| author | Richard M. Stallman | 1998-08-16 06:59:13 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-08-16 06:59:13 +0000 |
| commit | fca97d877ef2ea877da2a00e75509c9185707b43 (patch) | |
| tree | b838879a98460184653d42eb564b47128ecfe52e | |
| parent | fff05d8803be03464bc5c8d1a5e42eff726d1f23 (diff) | |
| download | emacs-fca97d877ef2ea877da2a00e75509c9185707b43.tar.gz emacs-fca97d877ef2ea877da2a00e75509c9185707b43.zip | |
(rmail-output): Always preserve MIME-Version field,
even if it was pruned.
| -rw-r--r-- | lisp/mail/rmailout.el | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el index 8c05dd3fb5f..7ced9999e55 100644 --- a/lisp/mail/rmailout.el +++ b/lisp/mail/rmailout.el | |||
| @@ -40,8 +40,8 @@ a file name as a string." | |||
| 40 | sexp))) | 40 | sexp))) |
| 41 | :group 'rmail-output) | 41 | :group 'rmail-output) |
| 42 | 42 | ||
| 43 | ;;; There are functions elsewhere in Emacs that use this function; check | 43 | ;;; There are functions elsewhere in Emacs that use this function; |
| 44 | ;;; them out before you change the calling method. | 44 | ;;; look at them before you change the calling method. |
| 45 | ;;;###autoload | 45 | ;;;###autoload |
| 46 | (defun rmail-output-to-rmail-file (file-name &optional count) | 46 | (defun rmail-output-to-rmail-file (file-name &optional count) |
| 47 | "Append the current message to an Rmail file named FILE-NAME. | 47 | "Append the current message to an Rmail file named FILE-NAME. |
| @@ -206,8 +206,8 @@ starting with the current one. Deleted messages are skipped and don't count." | |||
| 206 | (delete-region (point) | 206 | (delete-region (point) |
| 207 | (progn (forward-line 1) (point))))))))) | 207 | (progn (forward-line 1) (point))))))))) |
| 208 | 208 | ||
| 209 | ;;; There are functions elsewhere in Emacs that use this function; check | 209 | ;;; There are functions elsewhere in Emacs that use this function; |
| 210 | ;;; them out before you change the calling method. | 210 | ;;; look at them before you change the calling method. |
| 211 | ;;;###autoload | 211 | ;;;###autoload |
| 212 | (defun rmail-output (file-name &optional count noattribute from-gnus) | 212 | (defun rmail-output (file-name &optional count noattribute from-gnus) |
| 213 | "Append this message to system-inbox-format mail file named FILE-NAME. | 213 | "Append this message to system-inbox-format mail file named FILE-NAME. |
| @@ -274,18 +274,22 @@ The optional fourth argument FROM-GNUS is set when called from GNUS." | |||
| 274 | (forward-line 1) | 274 | (forward-line 1) |
| 275 | (= (following-char) ?0))))) | 275 | (= (following-char) ?0))))) |
| 276 | header-beginning | 276 | header-beginning |
| 277 | mail-from) | 277 | mail-from mime-version) |
| 278 | (while (> count 0) | 278 | (while (> count 0) |
| 279 | ;; Preserve the Mail-From and MIME-Version fields | ||
| 280 | ;; even if they have been pruned. | ||
| 279 | (or from-gnus | 281 | (or from-gnus |
| 280 | (setq mail-from | 282 | (save-excursion |
| 281 | (save-excursion | 283 | (save-restriction |
| 282 | (save-restriction | 284 | (widen) |
| 283 | (widen) | 285 | (goto-char (rmail-msgbeg rmail-current-message)) |
| 284 | (goto-char (rmail-msgbeg rmail-current-message)) | 286 | (setq header-beginning (point)) |
| 285 | (setq header-beginning (point)) | 287 | (search-forward "\n*** EOOH ***\n") |
| 286 | (search-forward "\n*** EOOH ***\n") | 288 | (narrow-to-region header-beginning (point)) |
| 287 | (narrow-to-region header-beginning (point)) | 289 | (setq mail-from |
| 288 | (mail-fetch-field "Mail-From"))))) | 290 | (mail-fetch-field "Mail-From") |
| 291 | mime-version | ||
| 292 | (mail-fetch-field "MIME-Version"))))) | ||
| 289 | (save-excursion | 293 | (save-excursion |
| 290 | (set-buffer tembuf) | 294 | (set-buffer tembuf) |
| 291 | (erase-buffer) | 295 | (erase-buffer) |
| @@ -301,6 +305,8 @@ The optional fourth argument FROM-GNUS is set when called from GNUS." | |||
| 301 | (mail-fetch-field "sender") | 305 | (mail-fetch-field "sender") |
| 302 | "unknown")) | 306 | "unknown")) |
| 303 | " " (current-time-string) "\n")) | 307 | " " (current-time-string) "\n")) |
| 308 | (if mime-version | ||
| 309 | (insert "MIME-Version: " mime-version "\n")) | ||
| 304 | ;; ``Quote'' "\nFrom " as "\n>From " | 310 | ;; ``Quote'' "\nFrom " as "\n>From " |
| 305 | ;; (note that this isn't really quoting, as there is no requirement | 311 | ;; (note that this isn't really quoting, as there is no requirement |
| 306 | ;; that "\n[>]+From " be quoted in the same transparent way.) | 312 | ;; that "\n[>]+From " be quoted in the same transparent way.) |