;;; message.el --- composing mail and news messages
-;; Copyright (C) 1996,97,98 Free Software Foundation, Inc.
+;; Copyright (C) 1996,97,98,99 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;;###autoload
(defcustom message-yank-prefix "> "
- "*Prefix inserted on the lines of yanked messages.
-nil means use indentation."
+ "*Prefix inserted on the lines of yanked messages."
:type 'string
:group 'message-insertion)
(defvar message-draft-coding-system
(cond
- ((not (fboundp 'coding-system-p)) nil)
- ((coding-system-p 'emacs-mule) 'emacs-mule)
- ((coding-system-p 'escape-quoted) 'escape-quoted)
- ((coding-system-p 'no-conversion) 'no-conversion)
+ ((not (fboundp 'find-coding-system)) nil)
+ ((find-coding-system 'emacs-mule) 'emacs-mule)
+ ((find-coding-system 'escape-quoted) 'escape-quoted)
+ ((find-coding-system 'no-conversion) 'no-conversion)
(t nil))
"Coding system to compose mail.")
-(defvar message-default-charset 'iso-8859-1
- "Default charset assumed to be used when viewing non-ASCII characters.
-This variable is used only in non-Mule Emacsen.")
-
;;; Internal variables.
(defvar message-buffer-list nil)
(defvar message-this-is-mail nil)
(defvar message-draft-article nil)
(defvar message-mime-part nil)
+(defvar message-posting-charset nil)
;; Byte-compiler warning
(defvar gnus-active-hashtb)
type (prin1-to-string file))))
(defun message-encode-message-body ()
- (let ((mm-default-charset message-default-charset)
- lines multipart-p)
+ (let (lines multipart-p content-type-p)
(message-goto-body)
(save-restriction
(narrow-to-region (point) (point-max))
(when lines
(insert lines))
(setq multipart-p
- (re-search-backward "^Content-Type: multipart/" nil t)))
+ (re-search-backward "^Content-Type: multipart/" nil t))
+ (goto-char (point-max))
+ (setq content-type-p
+ (re-search-backward "^Content-Type:" nil t)))
(save-restriction
(message-narrow-to-headers-or-head)
(message-remove-first-header "Content-Type")
(message-remove-first-header "Content-Transfer-Encoding"))
(message-goto-body)
(insert "This is a MIME multipart message. If you are reading\n")
- (insert "this, you shouldn't.\n"))))
+ (insert "this, you shouldn't.\n"))
+ ;; We always make sure that the message has a Content-Type header.
+ ;; This is because some broken MTAs and MUAs get awfully confused
+ ;; when confronted with a message with a MIME-Version header and
+ ;; without a Content-Type header. For instance, Solaris'
+ ;; /usr/bin/mail.
+ (unless content-type-p
+ (goto-char (point-min))
+ (re-search-forward "^MIME-Version:")
+ (forward-line 1)
+ (insert "Content-Type: text/plain; charset=us-ascii\n"))))
(defvar message-save-buffer " *encoding")
(defun message-save-drafts ()