From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#9392: 24.0.50; rmail-forward produces messages in unsupported format that cannot be customized away Date: Fri, 02 Sep 2011 21:47:33 +0300 Message-ID: <83fwkeeq7u.fsf@gnu.org> References: <83vctbcjco.fsf@gnu.org> <83r53zt453.fsf@gnu.org> <83liu6esgh.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1314989387 16711 80.91.229.12 (2 Sep 2011 18:49:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 2 Sep 2011 18:49:47 +0000 (UTC) Cc: 9392@debbugs.gnu.org To: julien@danjou.info Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 02 20:49:43 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QzYoB-0005Zd-3L for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Sep 2011 20:49:43 +0200 Original-Received: from localhost ([::1]:53213 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzYoA-0003C9-AJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Sep 2011 14:49:42 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:36112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzYo7-00039s-0g for bug-gnu-emacs@gnu.org; Fri, 02 Sep 2011 14:49:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzYo5-0007Fs-Nd for bug-gnu-emacs@gnu.org; Fri, 02 Sep 2011 14:49:38 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzYo5-0007Fm-Iv for bug-gnu-emacs@gnu.org; Fri, 02 Sep 2011 14:49:37 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QzYrO-0008F7-Jr; Fri, 02 Sep 2011 14:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Sep 2011 18:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9392 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9392-submit@debbugs.gnu.org id=B9392.131498955331647 (code B ref 9392); Fri, 02 Sep 2011 18:53:02 +0000 Original-Received: (at 9392) by debbugs.gnu.org; 2 Sep 2011 18:52:33 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QzYqv-0008EN-CY for submit@debbugs.gnu.org; Fri, 02 Sep 2011 14:52:33 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QzYqr-0008ED-B5 for 9392@debbugs.gnu.org; Fri, 02 Sep 2011 14:52:31 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LQW00600S433Y00@a-mtaout22.012.net.il> for 9392@debbugs.gnu.org; Fri, 02 Sep 2011 21:47:33 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.229.83.44]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LQW005AGS767YO0@a-mtaout22.012.net.il>; Fri, 02 Sep 2011 21:47:32 +0300 (IDT) In-reply-to: <83liu6esgh.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 02 Sep 2011 14:53:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:50550 Archived-At: > Date: Fri, 02 Sep 2011 20:59:10 +0300 > From: Eli Zaretskii > Cc: 9392@debbugs.gnu.org > > Done, thanks. Now on to the original problem... Is this the right way of converting MML to MIME when sendmail is used as the MUA? === modified file 'lisp/simple.el' --- lisp/simple.el 2011-07-28 14:05:07 +0000 +++ lisp/simple.el 2011-09-02 18:15:07 +0000 @@ -5727,6 +5727,11 @@ else the end of the last line. This fun "^\\([:\n]\\|[^: \t\n]+[ \t\n]\\)" nil 'move) (goto-char (match-beginning 0)))) +;; Used by Rmail (e.g., rmail-forward). +(defvar mail-encode-mml nil + "If non-nil, mail-user-agent's `sendfunc' command should mml-encode +the outgoing message before sending it.") + (defun compose-mail (&optional to subject other-headers continue switch-function yank-action send-actions return-action) === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2011-08-16 02:29:15 +0000 +++ lisp/mail/rmail.el 2011-09-02 18:41:09 +0000 @@ -91,6 +91,7 @@ its character representation and its dis (defvar messages-head) (defvar total-messages) (defvar tool-bar-map) +(defvar mail-encode-mml) (defvar rmail-header-style 'normal "The current header display style choice, one of @@ -642,7 +643,7 @@ unless the feature specified by `rmail-m :version "23.3" :group 'rmail) -(defvar rmail-enable-mime-composing nil +(defvar rmail-enable-mime-composing t "*If non-nil, RMAIL uses `rmail-insert-mime-forwarded-message-function' to forward.") ;; FIXME unused. @@ -3794,9 +3795,17 @@ see the documentation of `rmail-resend'. ;; Insert after header separator--before signature if any. (rfc822-goto-eoh) (forward-line 1) - (if (or rmail-enable-mime rmail-enable-mime-composing) - (funcall rmail-insert-mime-forwarded-message-function - forward-buffer) + (if (and rmail-enable-mime rmail-enable-mime-composing) + (prog1 + (funcall rmail-insert-mime-forwarded-message-function + forward-buffer) + ;; rmail-insert-mime-forwarded-message-function + ;; works by inserting MML tags into forward-buffer. + ;; The MUA will need to convert it to MIME before + ;; sending. mail-encode-mml tells them to do that. + ;; message.el does that automagically. + (or (eq mail-user-agent 'message-user-agent) + (setq mail-encode-mml t))) (insert "------- Start of forwarded message -------\n") ;; Quote lines with `- ' if they start with `-'. (let ((beg (point)) end) === modified file 'lisp/mail/sendmail.el' --- lisp/mail/sendmail.el 2011-08-04 00:58:07 +0000 +++ lisp/mail/sendmail.el 2011-09-02 18:46:19 +0000 @@ -31,6 +31,8 @@ (require 'rfc2047) +(require 'mml) + (defgroup sendmail nil "Mail sending commands for Emacs." :prefix "mail-" @@ -678,6 +680,7 @@ switching to, the `*mail*' buffer. See :options '(footnote-mode)) (defvar mail-mode-abbrev-table text-mode-abbrev-table) +(defvar mail-encode-mml) ;;;###autoload (define-derived-mode mail-mode text-mode "Mail" "Major mode for editing mail to be sent. @@ -701,6 +704,8 @@ Turning on Mail mode runs the normal hoo (make-local-variable 'mail-reply-action) (make-local-variable 'mail-send-actions) (make-local-variable 'mail-return-action) + (make-local-variable 'mail-encode-mml) + (setq mail-encode-mml nil) (setq buffer-offer-save t) (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(mail-font-lock-keywords t t)) @@ -934,6 +939,9 @@ the user from the mailer." (error "Invalid header line (maybe a continuation line lacks initial whitespace)")) (forward-line 1))) (goto-char opoint) + (when mail-encode-mml + (mml-to-mime) + (setq mail-encode-mml nil)) (run-hooks 'mail-send-hook) (message "Sending...") (funcall send-mail-function)