aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-09-23 00:06:25 +0200
committerLars Ingebrigtsen2019-09-23 00:07:07 +0200
commite3bd6c406da2ea98bfcf6bbd37db78462fd75b31 (patch)
tree39eb708ff718f3092b0e961c4dfa87662823b744
parent9aacc443d9465793b96cb844469056ae80e6d91b (diff)
downloademacs-e3bd6c406da2ea98bfcf6bbd37db78462fd75b31.tar.gz
emacs-e3bd6c406da2ea98bfcf6bbd37db78462fd75b31.zip
mailclient can't send attachments
* lisp/mail/mailclient.el (mailclient-send-it): Warn about trying to send attachments (bug#34992).
-rw-r--r--lisp/mail/mailclient.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el
index 4d8cda10fff..0c2594cc830 100644
--- a/lisp/mail/mailclient.el
+++ b/lisp/mail/mailclient.el
@@ -47,6 +47,7 @@
47(require 'sendmail) ;; for mail-sendmail-undelimit-header 47(require 'sendmail) ;; for mail-sendmail-undelimit-header
48(require 'mail-utils) ;; for mail-fetch-field 48(require 'mail-utils) ;; for mail-fetch-field
49(require 'browse-url) 49(require 'browse-url)
50(require 'mail-parse)
50 51
51(defcustom mailclient-place-body-on-clipboard-flag 52(defcustom mailclient-place-body-on-clipboard-flag
52 (fboundp 'w32-set-clipboard-data) 53 (fboundp 'w32-set-clipboard-data)
@@ -141,6 +142,14 @@ The mail client is taken to be the handler of mailto URLs."
141 (concat 142 (concat
142 (save-excursion 143 (save-excursion
143 (narrow-to-region (point-min) delimline) 144 (narrow-to-region (point-min) delimline)
145 ;; We can't send multipart/* messages (i. e. with
146 ;; attachments or the like) via this method.
147 (when-let ((type (mail-fetch-field "content-type")))
148 (when (and (string-match "multipart"
149 (car (mail-header-parse-content-type
150 type)))
151 (not (y-or-n-p "Message with attachments can't be sent via mailclient; continue anyway?")))
152 (error "Choose a different `send-mail-function' to send attachments")))
144 (goto-char (point-min)) 153 (goto-char (point-min))
145 (setq coding-system 154 (setq coding-system
146 (if (re-search-forward mime-charset-pattern nil t) 155 (if (re-search-forward mime-charset-pattern nil t)