2030 |
|
|
2031 |
;;; End of functions adopted from `message-utils.el'. |
;;; End of functions adopted from `message-utils.el'. |
2032 |
|
|
2033 |
|
(defun message-remove-duplicates (list) |
2034 |
|
(let (new) |
2035 |
|
(while list |
2036 |
|
(or (member (car list) new) |
2037 |
|
(setq new (cons (car list) new))) |
2038 |
|
(setq list (cdr list))) |
2039 |
|
(nreverse new))) |
2040 |
|
|
2041 |
(defun message-remove-header (header &optional is-regexp first reverse) |
(defun message-remove-header (header &optional is-regexp first reverse) |
2042 |
"Remove HEADER in the narrowed buffer. |
"Remove HEADER in the narrowed buffer. |
2043 |
If IS-REGEXP, HEADER is a regular expression. |
If IS-REGEXP, HEADER is a regular expression. |
4965 |
(let ((field (message-fetch-field header)) |
(let ((field (message-fetch-field header)) |
4966 |
rhs ace address) |
rhs ace address) |
4967 |
(when field |
(when field |
4968 |
(dolist (address (mail-header-parse-addresses field)) |
(dolist (rhs |
4969 |
(setq address (car address) |
(message-remove-duplicates |
4970 |
rhs (downcase (or (cadr (split-string address "@")) "")) |
(mapcar (lambda (rhs) (or (cadr (split-string rhs "@")) "")) |
4971 |
ace (downcase (idna-to-ascii rhs))) |
(mapcar 'downcase |
4972 |
|
(mapcar |
4973 |
|
'car (mail-header-parse-addresses field)))))) |
4974 |
|
(setq ace (downcase (idna-to-ascii rhs))) |
4975 |
(when (and (not (equal rhs ace)) |
(when (and (not (equal rhs ace)) |
4976 |
(or (not (eq message-use-idna 'ask)) |
(or (not (eq message-use-idna 'ask)) |
4977 |
(y-or-n-p (format "Replace %s with %s? " rhs ace)))) |
(y-or-n-p (format "Replace %s with %s in %s:? " |
4978 |
|
rhs ace header)))) |
4979 |
(goto-char (point-min)) |
(goto-char (point-min)) |
4980 |
(while (re-search-forward (concat "^" header ":") nil t) |
(while (re-search-forward (concat "^" header ":") nil t) |
4981 |
(message-narrow-to-field) |
(message-narrow-to-field) |
4994 |
(message-narrow-to-head) |
(message-narrow-to-head) |
4995 |
(message-idna-to-ascii-rhs-1 "From") |
(message-idna-to-ascii-rhs-1 "From") |
4996 |
(message-idna-to-ascii-rhs-1 "To") |
(message-idna-to-ascii-rhs-1 "To") |
4997 |
|
(message-idna-to-ascii-rhs-1 "Reply-To") |
4998 |
|
(message-idna-to-ascii-rhs-1 "Mail-Reply-To") |
4999 |
|
(message-idna-to-ascii-rhs-1 "Mail-Followup-To") |
5000 |
(message-idna-to-ascii-rhs-1 "Cc"))))) |
(message-idna-to-ascii-rhs-1 "Cc"))))) |
5001 |
|
|
5002 |
(defun message-generate-headers (headers) |
(defun message-generate-headers (headers) |