(require 'dired)
(require 'mm-util)
(require 'rfc2047)
+(require 'puny)
(autoload 'mailclient-send-it "mailclient")
(repeat :tag "Regexp List" regexp)))
(defsubst message-dont-reply-to-names ()
- (cond ((functionp message-dont-reply-to-names)
- message-dont-reply-to-names)
- ((stringp message-dont-reply-to-names)
- (gmm-regexp-concat message-dont-reply-to-names))))
+ (if (functionp message-dont-reply-to-names)
+ message-dont-reply-to-names
+ (gmm-regexp-concat message-dont-reply-to-names)))
(defvar message-shoot-gnksa-feet nil
"*A list of GNKSA feet you are allowed to shoot.
:type '(radio (const :format "%v " nil)
(string :format "FQDN: %v")))
-(defcustom message-use-idna
- (and (or (mm-coding-system-p 'utf-8)
- (condition-case nil
- (let (mucs-ignore-version-incompatibilities)
- (require 'un-define))
- (error)))
- (condition-case nil
- (require 'idna)
- (file-error)
- (invalid-operation))
- idna-program
- (executable-find idna-program)
- (string= (idna-to-ascii "räksmörgås") "xn--rksmrgs-5wao1o")
- t)
- "Whether to encode non-ASCII in domain names into ASCII according to IDNA.
-GNU Libidn, and in particular the elisp package \"idna.el\" and
-the external program \"idn\", must be installed for this
-functionality to work."
- :version "22.1"
+(defcustom message-use-idna t
+ "Whether to encode non-ASCII in domain names into ASCII according to IDNA."
+ :version "25.2"
:group 'message-headers
:link '(custom-manual "(message)IDNA")
:type '(choice (const :tag "Ask" ask)
(autoload 'gnus-output-to-rmail "gnus-util")
(autoload 'gnus-request-post "gnus-int")
(autoload 'gnus-server-string "gnus")
-(autoload 'idna-to-ascii "idna")
(autoload 'message-setup-toolbar "messagexmas")
(autoload 'mh-new-draft-name "mh-comp")
(autoload 'mh-send-letter "mh-comp")
"Remove trailing \"(was: <old subject>)\" from SUBJECT lines.
Leading \"Re: \" is not stripped by this function. Use the function
`message-strip-subject-re' for this."
- (let* ((query message-subject-trailing-was-query)
- (new) (found))
- (setq found
- (string-match
- (if (eq query 'ask)
- message-subject-trailing-was-ask-regexp
- message-subject-trailing-was-regexp)
- subject))
- (if found
- (setq new (substring subject 0 (match-beginning 0))))
- (if (or (not found) (eq query nil))
- subject
- (if (eq query 'ask)
- (if (message-y-or-n-p
- "Strip `(was: <old subject>)' in subject? " t
- (concat
- "Strip `(was: <old subject>)' in subject "
- "and use the new one instead?\n\n"
- "Current subject is: \""
- subject "\"\n\n"
- "New subject would be: \""
- new "\"\n\n"
- "See the variable `message-subject-trailing-was-query' "
- "to get rid of this query."
- ))
- new subject)
- new))))
+ (or
+ (let ((query message-subject-trailing-was-query) new)
+ (and query
+ (string-match (if (eq query 'ask)
+ message-subject-trailing-was-ask-regexp
+ message-subject-trailing-was-regexp)
+ subject)
+ (setq new (substring subject 0 (match-beginning 0)))
+ (or (not (eq query 'ask))
+ (message-y-or-n-p
+ "Strip `(was: <old subject>)' in subject? " t
+ (concat
+ "Strip `(was: <old subject>)' in subject "
+ "and use the new one instead?\n\n"
+ "Current subject is: \"" subject "\"\n\n"
+ "New subject would be: \"" new "\"\n\n"
+ "See the variable `message-subject-trailing-was-query' "
+ "to get rid of this query.")))
+ new))
+ subject))
;;; Suggested by Jonas Steverud @ www.dtek.chalmers.se/~d4jonas/
(setq adaptive-fill-first-line-regexp
(concat quote-prefix-regexp "\\|"
adaptive-fill-first-line-regexp)))
- (setq-default auto-fill-inhibit-regexp nil)
- (setq-default normal-auto-fill-function 'message-do-auto-fill))
+ (setq-local auto-fill-inhibit-regexp nil)
+ (setq-local normal-auto-fill-function 'message-do-auto-fill))
\f
(defun message-insert-formatted-citation-line (&optional from date tz)
"Function that inserts a formatted citation line.
The optional FROM, and DATE are strings containing the contents of
-the From header and the Date header respectively. The optional TZ
-is a number of seconds, overrides the time zone of DATE.
+the From header and the Date header respectively.
+
+The optional TZ is omitted or nil for Emacs local time, t for
+Universal Time, `wall' for system wall clock time, or a string as
+in the TZ environment variable. It can also be a list (as from
+`current-time-zone') or an integer (as from `decode-time')
+applied without consideration for daylight saving time.
See `message-citation-line-format'."
;; The optional args are for testing/debugging. They will disappear later.
(>= i ?a)))
(push i lst)
(push (condition-case nil
- (gmm-format-time-string (format "%%%c" i) time tz)
+ (format-time-string (format "%%%c" i) time tz)
(error (format ">%c<" i)))
lst))
(setq i (1+ i)))
;; the domain part, i.e., if it is a local user's address.
(setq ace (if (string-match "\\`[[:ascii:]]*\\'" rhs)
rhs
- (downcase (idna-to-ascii rhs))))
+ (downcase (puny-encode-domain rhs))))
(when (and (not (equal rhs ace))
(or (not (eq message-use-idna 'ask))
(y-or-n-p (format "Replace %s with %s in %s:? "
(let ((case-fold-search t))
(re-search-forward "^mime-version:" nil t)))
(message-inhibit-ecomplete t)
+ ;; We don't want smtpmail.el to encode anything, either.
+ (sendmail-coding-system 'raw-text)
+ (select-safe-coding-system-function nil)
message-required-mail-headers
message-generate-hashcash
rfc2047-encode-encoded-words)