From e778c38befd3d533621b969ba54990334e2257d7 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Thu, 6 Jun 2019 16:08:48 +0200 Subject: [PATCH] lisp/gnus/message.el (message--send-mail-maybe-partially): Extract --- lisp/gnus/message.el | 63 +++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 13d85d6f6ca..fb5a6b8a246 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4487,6 +4487,38 @@ This function could be useful in `message-setup-hook'." (unless (y-or-n-p "Send anyway? ") (error "Failed to send the message")))))) +(defun message--send-mail-maybe-partially () + (if (or (not message-send-mail-partially-limit) + (< (buffer-size) message-send-mail-partially-limit) + (not (message-y-or-n-p + "The message size is too large, split? " + t + "\ +The message size, " + (/ (buffer-size) 1000) "KB, is too large. + +Some mail gateways (MTA's) bounce large messages. To avoid the +problem, answer `y', and the message will be split into several +smaller pieces, the size of each is about " + (/ message-send-mail-partially-limit 1000) + "KB except the last +one. + +However, some mail readers (MUA's) can't read split messages, i.e., +mails in message/partially format. Answer `n', and the message will be +sent in one piece. + +The size limit is controlled by `message-send-mail-partially-limit'. +If you always want Gnus to send messages in one piece, set +`message-send-mail-partially-limit' to nil. +"))) + (progn + (message "Sending via mail...") + (if message-send-mail-real-function + (funcall message-send-mail-real-function) + (message-multi-smtp-send-mail))) + (message-send-mail-partially))) + (defun message-send-mail (&optional _) (require 'mail-utils) (let* ((tembuf (message-generate-new-buffer-clone-locals " message temp")) @@ -4601,36 +4633,7 @@ This function could be useful in `message-setup-hook'." (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) - (not (message-y-or-n-p - "The message size is too large, split? " - t - "\ -The message size, " - (/ (buffer-size) 1000) "KB, is too large. - -Some mail gateways (MTA's) bounce large messages. To avoid the -problem, answer `y', and the message will be split into several -smaller pieces, the size of each is about " - (/ message-send-mail-partially-limit 1000) - "KB except the last -one. - -However, some mail readers (MUA's) can't read split messages, i.e., -mails in message/partially format. Answer `n', and the message will be -sent in one piece. - -The size limit is controlled by `message-send-mail-partially-limit'. -If you always want Gnus to send messages in one piece, set -`message-send-mail-partially-limit' to nil. -"))) - (progn - (message "Sending via mail...") - (if message-send-mail-real-function - (funcall message-send-mail-real-function) - (message-multi-smtp-send-mail))) - (message-send-mail-partially)) + (message--send-mail-maybe-partially) (setq options message-options)) (kill-buffer tembuf)) (set-buffer mailbuf) -- 2.39.2