Update upstream source from tag 'upstream/1.14.9+0.20210529'
Update to upstream version '1.14.9+0.20210529'
with Debian dir ef4f07715685454fa423d7df0d18b98a57f708ab
Tatsuya Kinoshita
2 years ago
155 | 155 | (defvar mel-b-builtin t) |
156 | 156 | |
157 | 157 | (defcustom mel-b-builtin-garbage-strategy 'asis |
158 | "When non-nil, base64 decoder functions handle non-encoded garbage. When value is asis decoders keep garbage and when value is discard decoders delete garbage." | |
158 | "When non-nil, base64 decoder functions handle non-encoded | |
159 | garbage. When value is asis decoders keep garbage and when value | |
160 | is discard decoders delete garbage." | |
159 | 161 | :group 'mime |
160 | 162 | :type '(choice (const :tag "Keep as is" asis) |
161 | 163 | (const :tag "Discard" discard) |
161 | 161 | "Specify CCL-program symbol for `mime-lexical-analyze'. |
162 | 162 | When nil, do not use CCL. |
163 | 163 | See docstring of `std11-ccl-lexical-analyzer' for details of CCL-program. |
164 | If you modify `mime-lexical-analyzer', set this variable to nil or prepare corresponding CCL-program." | |
164 | If you modify `mime-lexical-analyzer', set this variable to nil | |
165 | or prepare corresponding CCL-program." | |
165 | 166 | :group 'mime |
166 | 167 | :type '(choice symbol (const :tag "Do not use CCL." nil))) |
167 | 168 |
110 | 110 | ;; mechanism. Please discuss in the emacs-mime mailing lists. |
111 | 111 | |
112 | 112 | (defun mime-visible-field-p (field-name visible-fields invisible-fields) |
113 | (or (catch 'found | |
114 | (while visible-fields | |
115 | (let ((regexp (car visible-fields))) | |
116 | (if (string-match regexp field-name) | |
117 | (throw 'found t))) | |
118 | (setq visible-fields (cdr visible-fields)))) | |
119 | (catch 'found | |
120 | (while invisible-fields | |
121 | (let ((regexp (car invisible-fields))) | |
122 | (if (string-match regexp field-name) | |
123 | (throw 'found nil))) | |
124 | (setq invisible-fields (cdr invisible-fields))) | |
125 | t))) | |
113 | (let ((case-fold-search t)) | |
114 | (catch 'found | |
115 | (while visible-fields | |
116 | (when (string-match (car visible-fields) field-name) | |
117 | (throw 'found t)) | |
118 | (setq visible-fields (cdr visible-fields))) | |
119 | (while invisible-fields | |
120 | (when (string-match (car invisible-fields) field-name) | |
121 | (throw 'found nil)) | |
122 | (setq invisible-fields (cdr invisible-fields))) | |
123 | t))) | |
126 | 124 | |
127 | 125 | (defun mime-insert-header-from-buffer (buffer start end |
128 | 126 | &optional invisible-fields |
129 | 127 | visible-fields) |
130 | (let ((the-buf (current-buffer)) | |
131 | (mode-obj (mime-find-field-presentation-method 'wide)) | |
132 | field-decoder | |
133 | f-b p f-e field-name len field field-body) | |
128 | (let ((mode-obj (mime-find-field-presentation-method 'wide)) | |
129 | field-decoder f-b p field-name field-body result) | |
134 | 130 | (with-current-buffer buffer |
135 | (save-restriction | |
136 | (narrow-to-region start end) | |
137 | (goto-char start) | |
138 | (while (re-search-forward std11-field-head-regexp nil t) | |
139 | (setq f-b (match-beginning 0) | |
140 | p (match-end 0) | |
141 | field-name (buffer-substring f-b p) | |
142 | len (string-width field-name) | |
143 | f-e (std11-field-end)) | |
144 | (when (mime-visible-field-p field-name | |
145 | visible-fields invisible-fields) | |
146 | (setq field (intern | |
147 | (capitalize (buffer-substring f-b (1- p)))) | |
148 | field-body (buffer-substring p f-e) | |
149 | field-decoder (inline (mime-find-field-decoder-internal | |
150 | field mode-obj))) | |
151 | (with-current-buffer the-buf | |
152 | (insert field-name) | |
153 | (insert (if field-decoder | |
154 | (funcall field-decoder field-body len) | |
155 | ;; Don't decode | |
156 | field-body)) | |
157 | (insert "\n")))))))) | |
131 | (goto-char start) | |
132 | (while (re-search-forward std11-field-head-regexp end t) | |
133 | (setq f-b (match-beginning 0) | |
134 | p (match-end 0) | |
135 | field-name (buffer-substring f-b p)) | |
136 | (when (mime-visible-field-p field-name | |
137 | visible-fields invisible-fields) | |
138 | (setq field-body (buffer-substring p (std11-field-end end)) | |
139 | field-decoder | |
140 | (mime-find-field-decoder-internal | |
141 | (intern (capitalize | |
142 | (buffer-substring-no-properties f-b (1- p)))) | |
143 | mode-obj) | |
144 | result | |
145 | (cons "\n" | |
146 | (cons (if field-decoder | |
147 | (funcall field-decoder | |
148 | field-body | |
149 | (string-width field-name)) | |
150 | ;; Don't decode | |
151 | field-body) | |
152 | (cons field-name result))))))) | |
153 | (when result | |
154 | (apply #'insert (nreverse result))))) | |
158 | 155 | |
159 | 156 | |
160 | 157 | ;;; @ end |
62 | 62 | |
63 | 63 | (defcustom sasl-xoauth2-host-url-table |
64 | 64 | '(;; Gmail |
65 | ("gmail\\.com$" | |
65 | ("\\.gmail\\.com$" | |
66 | 66 | "https://accounts.google.com/o/oauth2/v2/auth" |
67 | 67 | "https://www.googleapis.com/oauth2/v4/token" |
68 | 68 | "https://mail.google.com/" |
69 | 69 | nil) |
70 | 70 | ;; Outlook.com |
71 | ("outlook\\.com$" | |
71 | ("\\.outlook\\.com$" | |
72 | 72 | "https://login.live.com/oauth20_authorize.srf" |
73 | 73 | "https://login.live.com/oauth20_token.srf" |
74 | 74 | "wl.offline_access wl.imap" |
75 | 75 | ;; You need register redirect URL at Application Registration Portal |
76 | 76 | ;; https://apps.dev.microsoft.com/ |
77 | "http://localhost/result")) | |
77 | "http://localhost/result") | |
78 | ;; office365 | |
79 | ("\\.office365\\.com$" | |
80 | "https://login.microsoftonline.com/common/oauth2/v2.0/authorize" | |
81 | "https://login.microsoftonline.com/common/oauth2/v2.0/token" | |
82 | "https://outlook.office365.com/IMAP.AccessAsUser.All https://outlook.office365.com/POP.AccessAsUser.All https://outlook.office365.com/SMTP.Send offline_access" | |
83 | nil) | |
84 | ;; yahoo.com | |
85 | ("\\.yahoo\\.com$" | |
86 | "https://api.login.yahoo.com/oauth2/request_auth" | |
87 | "https://api.login.yahoo.com/oauth2/get_token" | |
88 | "mail-w" | |
89 | nil) | |
90 | ;; aol.com | |
91 | ("\\.aol\\.com$" | |
92 | "https://api.login.aol.com/oauth2/request_auth" | |
93 | "https://api.login.aol.com/oauth2/get_token" | |
94 | "mail-w" | |
95 | nil)) | |
78 | 96 | "List of OAuth 2.0 URLs. Each element of list is regexp for host, auth-url, token-url, scope and redirect-uri (optional)." |
79 | 97 | :type '(repeat (list |
80 | 98 | (regexp :tag "Regexp for Host") |
167 | 167 | ;;; |
168 | 168 | |
169 | 169 | (defcustom std11-unfold-strip-leading-tab t |
170 | "When non-nil, `std11-unfold-string' strips leading TAB, which is mainly added by incorrect folding." | |
170 | "When non-nil, `std11-unfold-string' strips leading TAB, which is | |
171 | mainly added by incorrect folding." | |
171 | 172 | :group 'news |
172 | 173 | :group 'mail |
173 | 174 | :type 'boolean) |
360 | 361 | 'std11-default-ccl-lexical-analyzer) |
361 | 362 | "Specify CCL-program symbol for `std11-lexical-analyze'. |
362 | 363 | When nil, do not use CCL. |
363 | CCL-program returns a string which expresses a cons. | |
364 | When cons's cdr is non-nil, CCL-program succeeds in analyzing and car is analyzed result. | |
365 | When cdr is nil,CCL-program fails in analyzing. | |
366 | If you modify `std11-lexical-analyzer', set this variable to nil or prepare corresponding CCL-program." | |
364 | ||
365 | CCL-program returns a string which expresses a cons. When cons's | |
366 | cdr is non-nil, CCL-program succeeds in analyzing and car is | |
367 | analyzed result. When cdr is nil, CCL-program fails in analyzing. | |
368 | If you modify `std11-lexical-analyzer', set this variable to nil | |
369 | or prepare corresponding CCL-program." | |
367 | 370 | :group 'news |
368 | 371 | :group 'mail |
369 | 372 | :type '(choice symbol (const :tag "Do not use CCL." nil))) |