diff options
| author | Richard M. Stallman | 2009-04-09 16:33:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2009-04-09 16:33:41 +0000 |
| commit | caf9510cb8a9923e6bab6be7fd9ff0ff156b572c (patch) | |
| tree | 7771ba018da9e7c9d8c7c2bb526b5e48a1b7cdd7 | |
| parent | 4909640742cdc85f8dab1f43f99a06372cabb109 (diff) | |
| download | emacs-caf9510cb8a9923e6bab6be7fd9ff0ff156b572c.tar.gz emacs-caf9510cb8a9923e6bab6be7fd9ff0ff156b572c.zip | |
* mail/sendmail.el (sendmail-send-it): Replace any
pre-existing Content-type header if we insert one.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/mail/sendmail.el | 23 |
2 files changed, 22 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7dfa903b336..de1235576e6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2009-04-09 Richard M Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * mail/sendmail.el (sendmail-send-it): Replace any | ||
| 4 | pre-existing Content-type header if we insert one. | ||
| 5 | |||
| 1 | 2009-04-09 Michael Albinus <michael.albinus@gmx.de> | 6 | 2009-04-09 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * net/tramp.el (tramp-file-name-handler-alist): Add | 8 | * net/tramp.el (tramp-file-name-handler-alist): Add |
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index c0b9ee55c11..b392ddcfac7 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el | |||
| @@ -1113,7 +1113,10 @@ external program defined by `sendmail-program'." | |||
| 1113 | (if (not (re-search-forward "^From:" delimline t)) | 1113 | (if (not (re-search-forward "^From:" delimline t)) |
| 1114 | (mail-insert-from-field)) | 1114 | (mail-insert-from-field)) |
| 1115 | ;; Possibly add a MIME header for the current coding system | 1115 | ;; Possibly add a MIME header for the current coding system |
| 1116 | (let (charset) | 1116 | (let (charset where-content-type) |
| 1117 | (goto-char (point-min)) | ||
| 1118 | (setq where-content-type | ||
| 1119 | (re-search-forward "^Content-type:" delimline t)) | ||
| 1117 | (goto-char (point-min)) | 1120 | (goto-char (point-min)) |
| 1118 | (and (eq mail-send-nonascii 'mime) | 1121 | (and (eq mail-send-nonascii 'mime) |
| 1119 | (not (re-search-forward "^MIME-version:" delimline t)) | 1122 | (not (re-search-forward "^MIME-version:" delimline t)) |
| @@ -1122,11 +1125,19 @@ external program defined by `sendmail-program'." | |||
| 1122 | selected-coding | 1125 | selected-coding |
| 1123 | (setq charset | 1126 | (setq charset |
| 1124 | (coding-system-get selected-coding :mime-charset)) | 1127 | (coding-system-get selected-coding :mime-charset)) |
| 1125 | (goto-char delimline) | 1128 | (progn |
| 1126 | (insert "MIME-version: 1.0\n" | 1129 | (goto-char delimline) |
| 1127 | "Content-type: text/plain; charset=" | 1130 | (insert "MIME-version: 1.0\n" |
| 1128 | (symbol-name charset) | 1131 | "Content-type: text/plain; charset=" |
| 1129 | "\nContent-Transfer-Encoding: 8bit\n"))) | 1132 | (symbol-name charset) |
| 1133 | "\nContent-Transfer-Encoding: 8bit\n") | ||
| 1134 | ;; The character set we will actually use | ||
| 1135 | ;; should override any specified in the message itself. | ||
| 1136 | (when where-content-type | ||
| 1137 | (goto-char where-content-type) | ||
| 1138 | (beginning-of-line) | ||
| 1139 | (delete-region (point) | ||
| 1140 | (progn (forward-line 1) (point))))))) | ||
| 1130 | ;; Insert an extra newline if we need it to work around | 1141 | ;; Insert an extra newline if we need it to work around |
| 1131 | ;; Sun's bug that swallows newlines. | 1142 | ;; Sun's bug that swallows newlines. |
| 1132 | (goto-char (1+ delimline)) | 1143 | (goto-char (1+ delimline)) |