From: Oleh Krehel Date: Mon, 3 Jun 2019 13:48:09 +0000 (+0200) Subject: lisp/gnus/message.el (message-send-mail): Don't wrongly assert on Unicode msg X-Git-Tag: emacs-27.0.90~2715 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=83c3a61e4ca091580cafbabe34b54e4a9261ad16;p=emacs.git lisp/gnus/message.el (message-send-mail): Don't wrongly assert on Unicode msg Using this setting: (setq message-send-mail-function 'message-send-mail-with-sendmail) (setq sendmail-program "msmtp") the message seding is handled by an external program, so no Unicode encoding is performed in Emacs. Thus Emacs must not assert that the Unicode encoding was performed. --- diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 29a8f25f31f..adaaa7e5f21 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4593,10 +4593,12 @@ This function could be useful in `message-setup-hook'." (message-insert-courtesy-copy (with-current-buffer mailbuf message-courtesy-message))) - ;; Let's make sure we encoded all the body. - (cl-assert (save-excursion - (goto-char (point-min)) - (not (re-search-forward "[^\000-\377]" nil t)))) + ;; If this was set, let `sendmail-program' handle the Unicode + (unless message-inhibit-body-encoding + ;; Let's make sure we encoded all the body. + (cl-assert (save-excursion + (goto-char (point-min)) + (not (re-search-forward "[^\000-\377]" nil t))))) (mm-disable-multibyte) (if (or (not message-send-mail-partially-limit) (< (buffer-size) message-send-mail-partially-limit)