From 83c3a61e4ca091580cafbabe34b54e4a9261ad16 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Mon, 3 Jun 2019 15:48:09 +0200 Subject: [PATCH] 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. --- lisp/gnus/message.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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) -- 2.39.2