summaryrefslogtreecommitdiff
path: root/lisp/mail
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-08-14 22:10:30 +0000
committerRichard M. Stallman <rms@gnu.org>1997-08-14 22:10:30 +0000
commit90eaba1d72d92b5545eb69a63b79f4ccb67b77d2 (patch)
tree0f2290085bdbb4e4ab485faabfc5f81dd70e17ca /lisp/mail
parent163af47c5e61e6d7038aaa269e1f8611aedf35cf (diff)
downloademacs-90eaba1d72d92b5545eb69a63b79f4ccb67b77d2.tar.gz
(mail-send): Ask for confirmation if
message contains non-ASCII characters. (mail-send-nonascii): New variable.
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/sendmail.el20
1 files changed, 19 insertions, 1 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index bd2e582efd0..55750ca03c2 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -178,6 +178,13 @@ The functions \\[mail-send-on-exit] or \\[mail-dont-send] select
the RMAIL summary buffer before returning, if it exists and this variable
is non-nil.")
+(defvar mail-send-nonascii 'query
+ "*Specify whether to allow sending non-ASCII characters in mail.
+If t, that means do allow it. nil means don't allow it.
+`query' means ask the user each time.
+Including non-ASCII characters in a mail message can be problematical
+for the recipient, who may not know how to decode them properly.")
+
;; Note: could use /usr/ucb/mail instead of sendmail;
;; options -t, and -v if not interactive.
(defvar mail-mailer-swallows-blank-line
@@ -555,7 +562,18 @@ the user from the mailer."
(y-or-n-p "Send buffer contents as mail message? ")
(or (buffer-modified-p)
(y-or-n-p "Message already sent; resend? ")))
- (let ((inhibit-read-only t))
+ (let ((inhibit-read-only t)
+ (opoint (point)))
+ (when (and enable-multibyte-characters
+ (not (eq mail-send-nonascii t)))
+ (goto-char (point-min))
+ (skip-chars-forward "\0-\177")
+ (or (= (point) (point-max))
+ (if (eq mail-send-nonascii 'query)
+ (or (y-or-n-p "Message contains non-ASCII characters; send anyway? ")
+ (error "Aborted"))
+ (error "Message contains non-ASCII characters"))))
+ (goto-char opoint)
(run-hooks 'mail-send-hook)
(message "Sending...")
(funcall send-mail-function)