* org.el (org-tree-to-indirect-buffer, org-convert-to-oddeven-levels)
[bpt/emacs.git] / lisp / gnus / message.el
CommitLineData
23f87bed 1;;; message.el --- composing mail and news messages
e84b4b86
TTN
2
3;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
ae940284 4;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
eec82323 5
6748645f 6;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
eec82323
LMI
7;; Keywords: mail, news
8
9;; This file is part of GNU Emacs.
10
5e809f55 11;; GNU Emacs is free software: you can redistribute it and/or modify
eec82323 12;; it under the terms of the GNU General Public License as published by
5e809f55
GM
13;; the Free Software Foundation, either version 3 of the License, or
14;; (at your option) any later version.
eec82323
LMI
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
5e809f55 18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
eec82323
LMI
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
5e809f55 22;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
eec82323
LMI
23
24;;; Commentary:
25
26;; This mode provides mail-sending facilities from within Emacs. It
27;; consists mainly of large chunks of code from the sendmail.el,
28;; gnus-msg.el and rnewspost.el files.
29
30;;; Code:
31
b43906b6
GM
32(eval-and-compile
33 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
16409b0b 34(eval-when-compile
9efa445f 35 (require 'cl))
b43906b6 36
01c52d31 37(require 'hashcash)
23f87bed 38(require 'canlock)
eec82323 39(require 'mailheader)
18c06a99 40(require 'gmm-utils)
eec82323 41(require 'nnheader)
23f87bed
MB
42;; This is apparently necessary even though things are autoloaded.
43;; Because we dynamically bind mail-abbrev-mode-regexp, we'd better
44;; require mailabbrev here.
16409b0b 45(if (featurep 'xemacs)
23f87bed
MB
46 (require 'mail-abbrevs)
47 (require 'mailabbrev))
16409b0b
GM
48(require 'mail-parse)
49(require 'mml)
23f87bed 50(require 'rfc822)
01c52d31
MB
51(require 'ecomplete)
52
2ea6167b
RS
53(autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
54
9efa445f
DN
55(defvar gnus-message-group-art)
56(defvar gnus-list-identifiers) ; gnus-sum is required where necessary
57(defvar rmail-enable-mime-composing)
eec82323
LMI
58
59(defgroup message '((user-mail-address custom-variable)
60 (user-full-name custom-variable))
61 "Mail and news message composing."
62 :link '(custom-manual "(message)Top")
63 :group 'mail
64 :group 'news)
65
66(put 'user-mail-address 'custom-type 'string)
67(put 'user-full-name 'custom-type 'string)
68
69(defgroup message-various nil
339ccc6a 70 "Various Message Variables."
eec82323
LMI
71 :link '(custom-manual "(message)Various Message Variables")
72 :group 'message)
73
74(defgroup message-buffers nil
339ccc6a 75 "Message Buffers."
eec82323
LMI
76 :link '(custom-manual "(message)Message Buffers")
77 :group 'message)
78
79(defgroup message-sending nil
339ccc6a 80 "Message Sending."
eec82323
LMI
81 :link '(custom-manual "(message)Sending Variables")
82 :group 'message)
83
84(defgroup message-interface nil
339ccc6a 85 "Message Interface."
eec82323
LMI
86 :link '(custom-manual "(message)Interface")
87 :group 'message)
88
89(defgroup message-forwarding nil
339ccc6a 90 "Message Forwarding."
eec82323
LMI
91 :link '(custom-manual "(message)Forwarding")
92 :group 'message-interface)
93
94(defgroup message-insertion nil
339ccc6a 95 "Message Insertion."
eec82323
LMI
96 :link '(custom-manual "(message)Insertion")
97 :group 'message)
98
99(defgroup message-headers nil
339ccc6a 100 "Message Headers."
eec82323
LMI
101 :link '(custom-manual "(message)Message Headers")
102 :group 'message)
103
104(defgroup message-news nil
339ccc6a 105 "Composing News Messages."
eec82323
LMI
106 :group 'message)
107
108(defgroup message-mail nil
339ccc6a 109 "Composing Mail Messages."
eec82323
LMI
110 :group 'message)
111
112(defgroup message-faces nil
113 "Faces used for message composing."
114 :group 'message
115 :group 'faces)
116
117(defcustom message-directory "~/Mail/"
118 "*Directory from which all other mail file variables are derived."
119 :group 'message-various
120 :type 'directory)
121
122(defcustom message-max-buffers 10
123 "*How many buffers to keep before starting to kill them off."
124 :group 'message-buffers
125 :type 'integer)
126
127(defcustom message-send-rename-function nil
128 "Function called to rename the buffer after sending it."
129 :group 'message-buffers
7d829636 130 :type '(choice function (const nil)))
eec82323
LMI
131
132(defcustom message-fcc-handler-function 'message-output
133 "*A function called to save outgoing articles.
134This function will be called with the name of the file to store the
135article in. The default function is `message-output' which saves in Unix
136mailbox format."
137 :type '(radio (function-item message-output)
138 (function :tag "Other"))
139 :group 'message-sending)
140
23f87bed
MB
141(defcustom message-fcc-externalize-attachments nil
142 "If non-nil, attachments are included as external parts in Fcc copies."
bf247b6e 143 :version "22.1"
23f87bed
MB
144 :type 'boolean
145 :group 'message-sending)
146
eec82323 147(defcustom message-courtesy-message
f129a4df 148 "The following message is a courtesy copy of an article\nthat has been posted to %s as well.\n\n"
eec82323
LMI
149 "*This is inserted at the start of a mailed copy of a posted message.
150If the string contains the format spec \"%s\", the Newsgroups
151the article has been posted to will be inserted there.
152If this variable is nil, no such courtesy message will be added."
153 :group 'message-sending
ad136a7c 154 :type '(radio string (const nil)))
eec82323 155
23f87bed
MB
156(defcustom message-ignored-bounced-headers
157 "^\\(Received\\|Return-Path\\|Delivered-To\\):"
eec82323
LMI
158 "*Regexp that matches headers to be removed in resent bounced mail."
159 :group 'message-interface
160 :type 'regexp)
161
eec82323
LMI
162(defcustom message-from-style 'default
163 "*Specifies how \"From\" headers look.
164
7d829636 165If nil, they contain just the return address like:
eec82323
LMI
166 king@grassland.com
167If `parens', they look like:
168 king@grassland.com (Elvis Parsley)
169If `angles', they look like:
170 Elvis Parsley <king@grassland.com>
171
172Otherwise, most addresses look like `angles', but they look like
173`parens' if `angles' would need quoting and `parens' would not."
174 :type '(choice (const :tag "simple" nil)
175 (const parens)
176 (const angles)
177 (const default))
178 :group 'message-headers)
179
23f87bed
MB
180(defcustom message-insert-canlock t
181 "Whether to insert a Cancel-Lock header in news postings."
bf247b6e 182 :version "22.1"
23f87bed
MB
183 :group 'message-headers
184 :type 'boolean)
185
186(defcustom message-syntax-checks
187 (if message-insert-canlock '((sender . disabled)) nil)
16409b0b 188 ;; Guess this one shouldn't be easy to customize...
6748645f 189 "*Controls what syntax checks should not be performed on outgoing posts.
eec82323
LMI
190To disable checking of long signatures, for instance, add
191 `(signature . disabled)' to this list.
192
193Don't touch this variable unless you really know what you're doing.
194
437ce4be
MB
195Checks include `approved', `bogus-recipient', `continuation-headers',
196`control-chars', `empty', `existing-newsgroups', `from', `illegible-text',
f362b760
MB
197`invisible-text', `long-header-lines', `long-lines', `message-id',
198`multiple-headers', `new-text', `newsgroups', `quoting-style',
5cfd0f2e 199`repeated-newsgroups', `reply-to', `sender', `sendsys', `shoot',
f362b760
MB
200`shorten-followup-to', `signature', `size', `subject', `subject-cmsg'
201and `valid-newsgroups'."
16409b0b 202 :group 'message-news
7d829636 203 :type '(repeat sexp)) ; Fixme: improve this
eec82323 204
23f87bed
MB
205(defcustom message-required-headers '((optional . References)
206 From)
207 "*Headers to be generated or prompted for when sending a message.
208Also see `message-required-news-headers' and
209`message-required-mail-headers'."
bf247b6e 210 :version "22.1"
23f87bed
MB
211 :group 'message-news
212 :group 'message-headers
213 :link '(custom-manual "(message)Message Headers")
214 :type '(repeat sexp))
215
01c52d31 216(defcustom message-draft-headers '(References From Date)
23f87bed 217 "*Headers to be generated when saving a draft message."
bf247b6e 218 :version "22.1"
23f87bed
MB
219 :group 'message-news
220 :group 'message-headers
221 :link '(custom-manual "(message)Message Headers")
222 :type '(repeat sexp))
223
eec82323
LMI
224(defcustom message-required-news-headers
225 '(From Newsgroups Subject Date Message-ID
23f87bed 226 (optional . Organization)
16409b0b 227 (optional . User-Agent))
6748645f 228 "*Headers to be generated or prompted for when posting an article.
eec82323
LMI
229RFC977 and RFC1036 require From, Date, Newsgroups, Subject,
230Message-ID. Organization, Lines, In-Reply-To, Expires, and
815b81c8 231User-Agent are optional. If you don't want message to insert some
eec82323
LMI
232header, remove it from this list."
233 :group 'message-news
234 :group 'message-headers
23f87bed 235 :link '(custom-manual "(message)Message Headers")
eec82323
LMI
236 :type '(repeat sexp))
237
238(defcustom message-required-mail-headers
23f87bed 239 '(From Subject Date (optional . In-Reply-To) Message-ID
16409b0b 240 (optional . User-Agent))
6748645f 241 "*Headers to be generated or prompted for when mailing a message.
23f87bed
MB
242It is recommended that From, Date, To, Subject and Message-ID be
243included. Organization and User-Agent are optional."
eec82323
LMI
244 :group 'message-mail
245 :group 'message-headers
23f87bed 246 :link '(custom-manual "(message)Message Headers")
eec82323
LMI
247 :type '(repeat sexp))
248
249(defcustom message-deletable-headers '(Message-ID Date Lines)
250 "Headers to be deleted if they already exist and were generated by message previously."
251 :group 'message-headers
23f87bed 252 :link '(custom-manual "(message)Message Headers")
eec82323
LMI
253 :type 'sexp)
254
255(defcustom message-ignored-news-headers
23f87bed 256 "^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
eec82323
LMI
257 "*Regexp of headers to be removed unconditionally before posting."
258 :group 'message-news
259 :group 'message-headers
23f87bed 260 :link '(custom-manual "(message)Message Headers")
8903a9c8
MB
261 :type '(repeat :value-to-internal (lambda (widget value)
262 (custom-split-regexp-maybe value))
263 :match (lambda (widget value)
264 (or (stringp value)
265 (widget-editable-list-match widget value)))
266 regexp))
eec82323 267
23f87bed
MB
268(defcustom message-ignored-mail-headers
269 "^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
eec82323
LMI
270 "*Regexp of headers to be removed unconditionally before mailing."
271 :group 'message-mail
272 :group 'message-headers
23f87bed 273 :link '(custom-manual "(message)Mail Headers")
eec82323
LMI
274 :type 'regexp)
275
b890d447 276(defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-ID:\\|^X-Complaints-To:\\|Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:\\|^X-Hashcash:\\|^X-Payment:\\|^Approved:"
eec82323
LMI
277 "*Header lines matching this regexp will be deleted before posting.
278It's best to delete old Path and Date headers before posting to avoid
279any confusion."
280 :group 'message-interface
23f87bed 281 :link '(custom-manual "(message)Superseding")
8903a9c8
MB
282 :type '(repeat :value-to-internal (lambda (widget value)
283 (custom-split-regexp-maybe value))
284 :match (lambda (widget value)
285 (or (stringp value)
286 (widget-editable-list-match widget value)))
287 regexp))
eec82323 288
23f87bed
MB
289(defcustom message-subject-re-regexp
290 "^[ \t]*\\([Rr][Ee]\\(\\[[0-9]*\\]\\)*:[ \t]*\\)*[ \t]*"
6748645f
LMI
291 "*Regexp matching \"Re: \" in the subject line."
292 :group 'message-various
23f87bed 293 :link '(custom-manual "(message)Message Headers")
6748645f
LMI
294 :type 'regexp)
295
23f87bed
MB
296;;; Start of variables adopted from `message-utils.el'.
297
298(defcustom message-subject-trailing-was-query 'ask
299 "*What to do with trailing \"(was: <old subject>)\" in subject lines.
300If nil, leave the subject unchanged. If it is the symbol `ask', query
301the user what do do. In this case, the subject is matched against
302`message-subject-trailing-was-ask-regexp'. If
303`message-subject-trailing-was-query' is t, always strip the trailing
304old subject. In this case, `message-subject-trailing-was-regexp' is
305used."
bf247b6e 306 :version "22.1"
23f87bed
MB
307 :type '(choice (const :tag "never" nil)
308 (const :tag "always strip" t)
01c52d31 309 (const ask))
23f87bed
MB
310 :link '(custom-manual "(message)Message Headers")
311 :group 'message-various)
312
313(defcustom message-subject-trailing-was-ask-regexp
314 "[ \t]*\\([[(]+[Ww][Aa][Ss][ \t]*.*[\])]+\\)"
315 "*Regexp matching \"(was: <old subject>)\" in the subject line.
316
317The function `message-strip-subject-trailing-was' uses this regexp if
318`message-subject-trailing-was-query' is set to the symbol `ask'. If
319the variable is t instead of `ask', use
320`message-subject-trailing-was-regexp' instead.
321
322It is okay to create some false positives here, as the user is asked."
bf247b6e 323 :version "22.1"
23f87bed
MB
324 :group 'message-various
325 :link '(custom-manual "(message)Message Headers")
326 :type 'regexp)
327
328(defcustom message-subject-trailing-was-regexp
329 "[ \t]*\\((*[Ww][Aa][Ss]:[ \t]*.*)\\)"
330 "*Regexp matching \"(was: <old subject>)\" in the subject line.
331
332If `message-subject-trailing-was-query' is set to t, the subject is
333matched against `message-subject-trailing-was-regexp' in
334`message-strip-subject-trailing-was'. You should use a regexp creating very
335few false positives here."
bf247b6e 336 :version "22.1"
23f87bed
MB
337 :group 'message-various
338 :link '(custom-manual "(message)Message Headers")
339 :type 'regexp)
340
23f87bed
MB
341;;; marking inserted text
342
23f87bed 343(defcustom message-mark-insert-begin
f129a4df 344 "--8<---------------cut here---------------start------------->8---\n"
23f87bed 345 "How to mark the beginning of some inserted text."
bf247b6e 346 :version "22.1"
23f87bed
MB
347 :type 'string
348 :link '(custom-manual "(message)Insertion Variables")
349 :group 'message-various)
350
23f87bed 351(defcustom message-mark-insert-end
f129a4df 352 "--8<---------------cut here---------------end--------------->8---\n"
23f87bed 353 "How to mark the end of some inserted text."
bf247b6e 354 :version "22.1"
23f87bed
MB
355 :type 'string
356 :link '(custom-manual "(message)Insertion Variables")
357 :group 'message-various)
358
f129a4df 359(defcustom message-archive-header "X-No-Archive: Yes\n"
23f87bed
MB
360 "Header to insert when you don't want your article to be archived.
361Archives \(such as groups.google.com\) respect this header."
bf247b6e 362 :version "22.1"
23f87bed
MB
363 :type 'string
364 :link '(custom-manual "(message)Header Commands")
365 :group 'message-various)
366
23f87bed
MB
367(defcustom message-archive-note
368 "X-No-Archive: Yes - save http://groups.google.com/"
369 "Note to insert why you wouldn't want this posting archived.
370If nil, don't insert any text in the body."
bf247b6e 371 :version "22.1"
ad136a7c 372 :type '(radio string (const nil))
23f87bed
MB
373 :link '(custom-manual "(message)Header Commands")
374 :group 'message-various)
375
376;;; Crossposts and Followups
377;; inspired by JoH-followup-to by Jochem Huhman <joh at gmx.de>
378;; new suggestions by R. Weikusat <rw at another.de>
379
380(defvar message-cross-post-old-target nil
381 "Old target for cross-posts or follow-ups.")
382(make-variable-buffer-local 'message-cross-post-old-target)
383
23f87bed
MB
384(defcustom message-cross-post-default t
385 "When non-nil `message-cross-post-followup-to' will perform a crosspost.
386If nil, `message-cross-post-followup-to' will only do a followup. Note that
387you can explicitly override this setting by calling
388`message-cross-post-followup-to' with a prefix."
bf247b6e 389 :version "22.1"
23f87bed
MB
390 :type 'boolean
391 :group 'message-various)
392
5f5475ac 393(defcustom message-cross-post-note "Crosspost & Followup-To: "
23f87bed 394 "Note to insert before signature to notify of cross-post and follow-up."
bf247b6e 395 :version "22.1"
23f87bed
MB
396 :type 'string
397 :group 'message-various)
398
5f5475ac 399(defcustom message-followup-to-note "Followup-To: "
23f87bed 400 "Note to insert before signature to notify of follow-up only."
bf247b6e 401 :version "22.1"
23f87bed
MB
402 :type 'string
403 :group 'message-various)
404
5f5475ac 405(defcustom message-cross-post-note-function 'message-cross-post-insert-note
23f87bed
MB
406 "Function to use to insert note about Crosspost or Followup-To.
407The function will be called with four arguments. The function should not only
408insert a note, but also ensure old notes are deleted. See the documentation
409for `message-cross-post-insert-note'."
bf247b6e 410 :version "22.1"
23f87bed
MB
411 :type 'function
412 :group 'message-various)
413
414;;; End of variables adopted from `message-utils.el'.
415
9b3ebcb6
MB
416(defcustom message-signature-separator "^-- $"
417 "Regexp matching the signature separator.
418This variable is used to strip off the signature from quoted text
419when `message-cite-function' is
420`message-cite-original-without-signature'. Most useful values
421are \"^-- $\" (strict) and \"^-- *$\" (loose; allow missing
422whitespace)."
423 :type '(choice (const :tag "strict" "^-- $")
424 (const :tag "loose" "^-- *$")
425 regexp)
d55fe5bb 426 :version "22.3" ;; Gnus 5.10.12 (changed default)
23f87bed 427 :link '(custom-manual "(message)Various Message Variables")
eec82323
LMI
428 :group 'message-various)
429
f129a4df 430(defcustom message-elide-ellipsis "\n[...]\n\n"
6748645f
LMI
431 "*The string which is inserted for elided text."
432 :type 'string
23f87bed 433 :link '(custom-manual "(message)Various Commands")
6748645f 434 :group 'message-various)
eec82323 435
23f87bed 436(defcustom message-interactive t
eec82323
LMI
437 "Non-nil means when sending a message wait for and display errors.
438nil means let mailer mail back a message to report errors."
439 :group 'message-sending
440 :group 'message-mail
23f87bed 441 :link '(custom-manual "(message)Sending Variables")
eec82323
LMI
442 :type 'boolean)
443
16dd13df 444(defcustom message-confirm-send nil
eef5ade7 445 "When non-nil, ask for confirmation when sending a message."
16dd13df
MB
446 :group 'message-sending
447 :group 'message-mail
4520e527 448 :version "23.1" ;; No Gnus
16dd13df
MB
449 :link '(custom-manual "(message)Sending Variables")
450 :type 'boolean)
451
16409b0b 452(defcustom message-generate-new-buffers 'unique
815b81c8
MB
453 "*Say whether to create a new message buffer to compose a message.
454Valid values include:
455
456nil
457 Generate the buffer name in the Message way (e.g., *mail*, *news*,
458 *mail to whom*, *news on group*, etc.) and continue editing in the
459 existing buffer of that name. If there is no such buffer, it will
460 be newly created.
461
462`unique' or t
463 Create the new buffer with the name generated in the Message way.
464
465`unsent'
466 Similar to `unique' but the buffer name begins with \"*unsent \".
467
468`standard'
469 Similar to nil but the buffer name is simpler like *mail message*.
470
471function
472 If this is a function, call that function with three parameters:
473 The type, the To address and the group name (any of these may be nil).
474 The function should return the new buffer name."
eec82323 475 :group 'message-buffers
23f87bed 476 :link '(custom-manual "(message)Message Buffers")
815b81c8
MB
477 :type '(choice (const nil)
478 (sexp :tag "unique" :format "unique\n" :value unique
479 :match (lambda (widget value) (memq value '(unique t))))
480 (const unsent)
481 (const standard)
482 (function :format "\n %{%t%}: %v")))
eec82323
LMI
483
484(defcustom message-kill-buffer-on-exit nil
485 "*Non-nil means that the message buffer will be killed after sending a message."
486 :group 'message-buffers
23f87bed 487 :link '(custom-manual "(message)Message Buffers")
eec82323
LMI
488 :type 'boolean)
489
01c52d31
MB
490(defcustom message-kill-buffer-query t
491 "*Non-nil means that killing a modified message buffer has to be confirmed.
492This is used by `message-kill-buffer'."
330f707b 493 :version "23.1" ;; No Gnus
01c52d31
MB
494 :group 'message-buffers
495 :type 'boolean)
496
9efa445f 497(defvar gnus-local-organization)
eec82323
LMI
498(defcustom message-user-organization
499 (or (and (boundp 'gnus-local-organization)
500 (stringp gnus-local-organization)
501 gnus-local-organization)
502 (getenv "ORGANIZATION")
503 t)
504 "*String to be used as an Organization header.
505If t, use `message-user-organization-file'."
506 :group 'message-headers
507 :type '(choice string
508 (const :tag "consult file" t)))
509
01c52d31
MB
510(defcustom message-user-organization-file
511 (let (orgfile)
512 (dolist (f (list "/etc/organization"
513 "/etc/news/organization"
514 "/usr/lib/news/organization"))
515 (when (file-readable-p f)
516 (setq orgfile f)))
517 orgfile)
eec82323
LMI
518 "*Local news organization file."
519 :type 'file
23f87bed 520 :link '(custom-manual "(message)News Headers")
eec82323
LMI
521 :group 'message-headers)
522
6748645f 523(defcustom message-make-forward-subject-function
23f87bed 524 #'message-forward-subject-name-subject
7d829636 525 "*List of functions called to generate subject headers for forwarded messages.
6748645f
LMI
526The subject generated by the previous function is passed into each
527successive function.
528
529The provided functions are:
530
23f87bed
MB
531* `message-forward-subject-author-subject' Source of article (author or
532 newsgroup), in brackets followed by the subject
533* `message-forward-subject-name-subject' Source of article (name of author
534 or newsgroup), in brackets followed by the subject
535* `message-forward-subject-fwd' Subject of article with 'Fwd:' prepended
6748645f 536 to it."
16409b0b 537 :group 'message-forwarding
23f87bed 538 :link '(custom-manual "(message)Forwarding")
16409b0b 539 :type '(radio (function-item message-forward-subject-author-subject)
7d829636 540 (function-item message-forward-subject-fwd)
23f87bed 541 (function-item message-forward-subject-name-subject)
7d829636 542 (repeat :tag "List of functions" function)))
16409b0b
GM
543
544(defcustom message-forward-as-mime t
23f87bed
MB
545 "*Non-nil means forward messages as an inline/rfc822 MIME section.
546Otherwise, directly inline the old message in the forwarded message."
2d447df6 547 :version "21.1"
16409b0b 548 :group 'message-forwarding
23f87bed 549 :link '(custom-manual "(message)Forwarding")
16409b0b
GM
550 :type 'boolean)
551
23f87bed
MB
552(defcustom message-forward-show-mml 'best
553 "*Non-nil means show forwarded messages as MML (decoded from MIME).
554Otherwise, forwarded messages are unchanged.
555Can also be the symbol `best' to indicate that MML should be
556used, except when it is a bad idea to use MML. One example where
557it is a bad idea is when forwarding a signed or encrypted
558message, because converting MIME to MML would invalidate the
559digital signature."
88818fbe 560 :version "21.1"
16409b0b 561 :group 'message-forwarding
23f87bed
MB
562 :type '(choice (const :tag "use MML" t)
563 (const :tag "don't use MML " nil)
564 (const :tag "use MML when appropriate" best)))
16409b0b
GM
565
566(defcustom message-forward-before-signature t
23f87bed 567 "*Non-nil means put forwarded message before signature, else after."
16409b0b
GM
568 :group 'message-forwarding
569 :type 'boolean)
6748645f
LMI
570
571(defcustom message-wash-forwarded-subjects nil
23f87bed
MB
572 "*Non-nil means try to remove as much cruft as possible from the subject.
573Done before generating the new subject of a forward."
6748645f 574 :group 'message-forwarding
23f87bed 575 :link '(custom-manual "(message)Forwarding")
6748645f
LMI
576 :type 'boolean)
577
dd58a686
SM
578(defcustom message-ignored-resent-headers
579 ;; `Delivered-To' needs to be removed because some mailers use it to
580 ;; detect loops, so if you resend a message to an address that ultimately
581 ;; comes back to you (e.g. a mailing-list to which you subscribe, in which
582 ;; case you may be removed from the list on the grounds that mail to you
583 ;; bounced with a "mailing loop" error).
584 "^Return-receipt\\|^X-Gnus\\|^Gnus-Warning:\\|^>?From \\|^Delivered-To:"
eec82323
LMI
585 "*All headers that match this regexp will be deleted when resending a message."
586 :group 'message-interface
23f87bed 587 :link '(custom-manual "(message)Resending")
8903a9c8
MB
588 :type '(repeat :value-to-internal (lambda (widget value)
589 (custom-split-regexp-maybe value))
590 :match (lambda (widget value)
591 (or (stringp value)
592 (widget-editable-list-match widget value)))
593 regexp))
eec82323 594
16409b0b
GM
595(defcustom message-forward-ignored-headers "^Content-Transfer-Encoding:\\|^X-Gnus"
596 "*All headers that match this regexp will be deleted when forwarding a message."
2d447df6 597 :version "21.1"
16409b0b 598 :group 'message-forwarding
8903a9c8
MB
599 :type '(repeat :value-to-internal (lambda (widget value)
600 (custom-split-regexp-maybe value))
601 :match (lambda (widget value)
602 (or (stringp value)
603 (widget-editable-list-match widget value)))
16409b0b
GM
604 regexp))
605
eec82323
LMI
606(defcustom message-ignored-cited-headers "."
607 "*Delete these headers from the messages you yank."
608 :group 'message-insertion
23f87bed
MB
609 :link '(custom-manual "(message)Insertion Variables")
610 :type 'regexp)
611
612(defcustom message-cite-prefix-regexp
b890d447
MB
613 (if (string-match "[[:digit:]]" "1")
614 ;; Support POSIX? XEmacs 21.5.27 doesn't.
615 "\\([ \t]*[_.[:word:]]+>+\\|[ \t]*[]>|}]\\)+"
23f87bed 616 ;; ?-, ?_ or ?. MUST NOT be in syntax entry w.
01c52d31
MB
617 (let (non-word-constituents)
618 (with-syntax-table text-mode-syntax-table
619 (setq non-word-constituents
620 (concat
01c52d31
MB
621 (if (string-match "\\w" "_") "" "_")
622 (if (string-match "\\w" ".") "" "."))))
23f87bed 623 (if (equal non-word-constituents "")
b890d447 624 "\\([ \t]*\\(\\w\\)+>+\\|[ \t]*[]>|}]\\)+"
23f87bed
MB
625 (concat "\\([ \t]*\\(\\w\\|["
626 non-word-constituents
b890d447 627 "]\\)+>+\\|[ \t]*[]>|}]\\)+"))))
23f87bed 628 "*Regexp matching the longest possible citation prefix on a line."
bf247b6e 629 :version "22.1"
23f87bed
MB
630 :group 'message-insertion
631 :link '(custom-manual "(message)Insertion Variables")
01c52d31
MB
632 :type 'regexp
633 :set (lambda (symbol value)
634 (prog1
635 (custom-set-default symbol value)
636 (if (boundp 'gnus-message-cite-prefix-regexp)
637 (setq gnus-message-cite-prefix-regexp
638 (concat "^\\(?:" value "\\)"))))))
eec82323 639
f129a4df 640(defcustom message-cancel-message "I am canceling my own article.\n"
eec82323
LMI
641 "Message to be inserted in the cancel message."
642 :group 'message-interface
23f87bed 643 :link '(custom-manual "(message)Canceling News")
eec82323
LMI
644 :type 'string)
645
5e174b3d
RS
646(defvar smtpmail-default-smtp-server)
647
2ea6167b
RS
648(defun message-send-mail-function ()
649 "Return suitable value for the variable `message-send-mail-function'."
b62a39c4
RS
650 (cond ((and (require 'sendmail)
651 (boundp 'sendmail-program)
652 sendmail-program
9e0a8576 653 (executable-find sendmail-program))
2ea6167b 654 'message-send-mail-with-sendmail)
9e0a8576
RS
655 ((and (locate-library "smtpmail")
656 (require 'smtpmail)
657 smtpmail-default-smtp-server)
658 'message-smtpmail-send-it)
659 ((locate-library "mailclient")
2ea6167b
RS
660 'message-send-mail-with-mailclient)
661 (t
9e0a8576 662 (lambda ()
82816ba1 663 (error "Don't know how to send mail. Please customize `message-send-mail-function'")))))
2ea6167b 664
eec82323 665;; Useful to set in site-init.el
2ea6167b 666(defcustom message-send-mail-function (message-send-mail-function)
eec82323
LMI
667 "Function to call to send the current buffer as mail.
668The headers should be delimited by a line whose contents match the
669variable `mail-header-separator'.
670
2ea6167b 671Valid values include `message-send-mail-with-sendmail'
7d829636 672`message-send-mail-with-mh', `message-send-mail-with-qmail',
2ea6167b
RS
673`message-smtpmail-send-it', `smtpmail-send-it',
674`feedmail-send-it' and `message-send-mail-with-mailclient'. The
8f7abae3
MB
675default is system dependent and determined by the function
676`message-send-mail-function'.
7d829636
DL
677
678See also `send-mail-function'."
eec82323
LMI
679 :type '(radio (function-item message-send-mail-with-sendmail)
680 (function-item message-send-mail-with-mh)
681 (function-item message-send-mail-with-qmail)
23f87bed 682 (function-item message-smtpmail-send-it)
6748645f 683 (function-item smtpmail-send-it)
7d829636 684 (function-item feedmail-send-it)
2ea6167b
RS
685 (function-item message-send-mail-with-mailclient
686 :tag "Use Mailclient package")
687 (function :tag "Other"))
eec82323 688 :group 'message-sending
330f707b 689 :version "23.1" ;; No Gnus
2ea6167b 690 :initialize 'custom-initialize-default
23f87bed 691 :link '(custom-manual "(message)Mail Variables")
eec82323
LMI
692 :group 'message-mail)
693
694(defcustom message-send-news-function 'message-send-news
695 "Function to call to send the current buffer as news.
696The headers should be delimited by a line whose contents match the
697variable `mail-header-separator'."
698 :group 'message-sending
699 :group 'message-news
23f87bed 700 :link '(custom-manual "(message)News Variables")
eec82323
LMI
701 :type 'function)
702
703(defcustom message-reply-to-function nil
7d829636 704 "If non-nil, function that should return a list of headers.
eec82323
LMI
705This function should pick out addresses from the To, Cc, and From headers
706and respond with new To and Cc headers."
707 :group 'message-interface
23f87bed 708 :link '(custom-manual "(message)Reply")
7d829636 709 :type '(choice function (const nil)))
eec82323
LMI
710
711(defcustom message-wide-reply-to-function nil
7d829636 712 "If non-nil, function that should return a list of headers.
eec82323
LMI
713This function should pick out addresses from the To, Cc, and From headers
714and respond with new To and Cc headers."
715 :group 'message-interface
23f87bed 716 :link '(custom-manual "(message)Wide Reply")
7d829636 717 :type '(choice function (const nil)))
eec82323
LMI
718
719(defcustom message-followup-to-function nil
7d829636 720 "If non-nil, function that should return a list of headers.
eec82323
LMI
721This function should pick out addresses from the To, Cc, and From headers
722and respond with new To and Cc headers."
723 :group 'message-interface
23f87bed 724 :link '(custom-manual "(message)Followup")
7d829636 725 :type '(choice function (const nil)))
eec82323 726
01c52d31
MB
727(defcustom message-extra-wide-headers nil
728 "If non-nil, a list of additional address headers.
729These are used when composing a wide reply."
730 :group 'message-sending
731 :type '(repeat string))
732
eec82323
LMI
733(defcustom message-use-followup-to 'ask
734 "*Specifies what to do with Followup-To header.
735If nil, always ignore the header. If it is t, use its value, but
736query before using the \"poster\" value. If it is the symbol `ask',
737always query the user whether to use the value. If it is the symbol
738`use', always use the value."
739 :group 'message-interface
23f87bed 740 :link '(custom-manual "(message)Followup")
eec82323 741 :type '(choice (const :tag "ignore" nil)
23f87bed 742 (const :tag "use & query" t)
eec82323
LMI
743 (const use)
744 (const ask)))
745
23f87bed
MB
746(defcustom message-use-mail-followup-to 'use
747 "*Specifies what to do with Mail-Followup-To header.
748If nil, always ignore the header. If it is the symbol `ask', always
749query the user whether to use the value. If it is the symbol `use',
750always use the value."
bf247b6e 751 :version "22.1"
23f87bed
MB
752 :group 'message-interface
753 :link '(custom-manual "(message)Mailing Lists")
754 :type '(choice (const :tag "ignore" nil)
755 (const use)
756 (const ask)))
757
758(defcustom message-subscribed-address-functions nil
759 "*Specifies functions for determining list subscription.
760If nil, do not attempt to determine list subscription with functions.
761If non-nil, this variable contains a list of functions which return
762regular expressions to match lists. These functions can be used in
763conjunction with `message-subscribed-regexps' and
764`message-subscribed-addresses'."
bf247b6e 765 :version "22.1"
23f87bed
MB
766 :group 'message-interface
767 :link '(custom-manual "(message)Mailing Lists")
768 :type '(repeat sexp))
769
770(defcustom message-subscribed-address-file nil
771 "*A file containing addresses the user is subscribed to.
772If nil, do not look at any files to determine list subscriptions. If
773non-nil, each line of this file should be a mailing list address."
bf247b6e 774 :version "22.1"
23f87bed
MB
775 :group 'message-interface
776 :link '(custom-manual "(message)Mailing Lists")
ad136a7c 777 :type '(radio file (const nil)))
23f87bed
MB
778
779(defcustom message-subscribed-addresses nil
780 "*Specifies a list of addresses the user is subscribed to.
781If nil, do not use any predefined list subscriptions. This list of
782addresses can be used in conjunction with
783`message-subscribed-address-functions' and `message-subscribed-regexps'."
bf247b6e 784 :version "22.1"
23f87bed
MB
785 :group 'message-interface
786 :link '(custom-manual "(message)Mailing Lists")
787 :type '(repeat string))
788
789(defcustom message-subscribed-regexps nil
790 "*Specifies a list of addresses the user is subscribed to.
791If nil, do not use any predefined list subscriptions. This list of
792regular expressions can be used in conjunction with
793`message-subscribed-address-functions' and `message-subscribed-addresses'."
bf247b6e 794 :version "22.1"
23f87bed
MB
795 :group 'message-interface
796 :link '(custom-manual "(message)Mailing Lists")
797 :type '(repeat regexp))
798
799(defcustom message-allow-no-recipients 'ask
800 "Specifies what to do when there are no recipients other than Gcc/Fcc.
801If it is the symbol `always', the posting is allowed. If it is the
802symbol `never', the posting is not allowed. If it is the symbol
803`ask', you are prompted."
bf247b6e 804 :version "22.1"
23f87bed
MB
805 :group 'message-interface
806 :link '(custom-manual "(message)Message Headers")
807 :type '(choice (const always)
808 (const never)
809 (const ask)))
810
eec82323 811(defcustom message-sendmail-f-is-evil nil
7d829636 812 "*Non-nil means don't add \"-f username\" to the sendmail command line.
16409b0b 813Doing so would be even more evil than leaving it out."
eec82323 814 :group 'message-sending
23f87bed 815 :link '(custom-manual "(message)Mail Variables")
eec82323
LMI
816 :type 'boolean)
817
23f87bed
MB
818(defcustom message-sendmail-envelope-from nil
819 "*Envelope-from when sending mail with sendmail.
820If this is nil, use `user-mail-address'. If it is the symbol
821`header', use the From: header of the message."
bf247b6e 822 :version "22.1"
23f87bed
MB
823 :type '(choice (string :tag "From name")
824 (const :tag "Use From: header from message" header)
825 (const :tag "Use `user-mail-address'" nil))
826 :link '(custom-manual "(message)Mail Variables")
827 :group 'message-sending)
828
01c52d31
MB
829(defcustom message-sendmail-extra-arguments nil
830 "Additional arguments to `sendmail-program'."
831 ;; E.g. '("-a" "account") for msmtp
330f707b 832 :version "23.1" ;; No Gnus
01c52d31
MB
833 :type '(repeat string)
834 ;; :link '(custom-manual "(message)Mail Variables")
835 :group 'message-sending)
836
eec82323
LMI
837;; qmail-related stuff
838(defcustom message-qmail-inject-program "/var/qmail/bin/qmail-inject"
839 "Location of the qmail-inject program."
840 :group 'message-sending
23f87bed 841 :link '(custom-manual "(message)Mail Variables")
eec82323
LMI
842 :type 'file)
843
844(defcustom message-qmail-inject-args nil
845 "Arguments passed to qmail-inject programs.
23f87bed
MB
846This should be a list of strings, one string for each argument. It
847may also be a function.
eec82323
LMI
848
849For e.g., if you wish to set the envelope sender address so that bounces
850go to the right place or to deal with listserv's usage of that address, you
851might set this variable to '(\"-f\" \"you@some.where\")."
852 :group 'message-sending
23f87bed
MB
853 :link '(custom-manual "(message)Mail Variables")
854 :type '(choice (function)
855 (repeat string)))
eec82323 856
9efa445f
DN
857(defvar gnus-post-method)
858(defvar gnus-select-method)
eec82323
LMI
859(defcustom message-post-method
860 (cond ((and (boundp 'gnus-post-method)
6748645f 861 (listp gnus-post-method)
eec82323
LMI
862 gnus-post-method)
863 gnus-post-method)
864 ((boundp 'gnus-select-method)
865 gnus-select-method)
866 (t '(nnspool "")))
6748645f
LMI
867 "*Method used to post news.
868Note that when posting from inside Gnus, for instance, this
869variable isn't used."
eec82323
LMI
870 :group 'message-news
871 :group 'message-sending
872 ;; This should be the `gnus-select-method' widget, but that might
873 ;; create a dependence to `gnus.el'.
874 :type 'sexp)
875
23f87bed
MB
876;; FIXME: This should be a temporary workaround until someone implements a
877;; proper solution. If a crash happens while replying, the auto-save file
878;; will *not* have a `References:' header if `message-generate-headers-first'
879;; is nil. See: http://article.gmane.org/gmane.emacs.gnus.general/51138
880(defcustom message-generate-headers-first '(references)
881 "Which headers should be generated before starting to compose a message.
f5d01350 882If t, generate all required headers. This can also be a list of headers to
23f87bed
MB
883generate. The variables `message-required-news-headers' and
884`message-required-mail-headers' specify which headers to generate.
885
886Note that the variable `message-deletable-headers' specifies headers which
887are to be deleted and then re-generated before sending, so this variable
888will not have a visible effect for those headers."
eec82323 889 :group 'message-headers
23f87bed
MB
890 :link '(custom-manual "(message)Message Headers")
891 :type '(choice (const :tag "None" nil)
01c52d31
MB
892 (const :tag "References" '(references))
893 (const :tag "All" t)
894 (repeat (sexp :tag "Header"))))
895
896(defcustom message-fill-column 72
897 "Column beyond which automatic line-wrapping should happen.
898Local value for message buffers. If non-nil, also turn on
899auto-fill in message buffers."
900 :group 'message-various
901 ;; :link '(custom-manual "(message)Message Headers")
902 :type '(choice (const :tag "Don't turn on auto fill" nil)
903 (integer)))
eec82323
LMI
904
905(defcustom message-setup-hook nil
906 "Normal hook, run each time a new outgoing message is initialized.
907The function `message-setup' runs this hook."
908 :group 'message-various
23f87bed 909 :link '(custom-manual "(message)Various Message Variables")
eec82323
LMI
910 :type 'hook)
911
16409b0b
GM
912(defcustom message-cancel-hook nil
913 "Hook run when cancelling articles."
914 :group 'message-various
23f87bed 915 :link '(custom-manual "(message)Various Message Variables")
16409b0b
GM
916 :type 'hook)
917
eec82323
LMI
918(defcustom message-signature-setup-hook nil
919 "Normal hook, run each time a new outgoing message is initialized.
920It is run after the headers have been inserted and before
921the signature is inserted."
922 :group 'message-various
23f87bed 923 :link '(custom-manual "(message)Various Message Variables")
eec82323
LMI
924 :type 'hook)
925
926(defcustom message-mode-hook nil
927 "Hook run in message mode buffers."
928 :group 'message-various
929 :type 'hook)
930
931(defcustom message-header-hook nil
932 "Hook run in a message mode buffer narrowed to the headers."
933 :group 'message-various
934 :type 'hook)
935
936(defcustom message-header-setup-hook nil
6748645f 937 "Hook called narrowed to the headers when setting up a message buffer."
eec82323 938 :group 'message-various
23f87bed 939 :link '(custom-manual "(message)Various Message Variables")
eec82323
LMI
940 :type 'hook)
941
23f87bed
MB
942(defcustom message-minibuffer-local-map
943 (let ((map (make-sparse-keymap 'message-minibuffer-local-map)))
944 (set-keymap-parent map minibuffer-local-map)
945 map)
e2642250 946 "Keymap for `message-read-from-minibuffer'."
d0859c9a
MB
947 :version "22.1"
948 :group 'message-various)
23f87bed 949
eec82323 950(defcustom message-citation-line-function 'message-insert-citation-line
23f87bed
MB
951 "*Function called to insert the \"Whomever writes:\" line.
952
01c52d31 953Predefined functions include `message-insert-citation-line' and
4d8a28ec 954`message-insert-formatted-citation-line' (see the variable
01c52d31
MB
955`message-citation-line-format').
956
23f87bed
MB
957Note that Gnus provides a feature where the reader can click on
958`writes:' to hide the cited text. If you change this line too much,
959people who read your message will have to change their Gnus
960configuration. See the variable `gnus-cite-attribution-suffix'."
01c52d31
MB
961 :type '(choice
962 (function-item :tag "plain" message-insert-citation-line)
4d8a28ec 963 (function-item :tag "formatted" message-insert-formatted-citation-line)
01c52d31 964 (function :tag "Other"))
23f87bed 965 :link '(custom-manual "(message)Insertion Variables")
eec82323
LMI
966 :group 'message-insertion)
967
01c52d31
MB
968(defcustom message-citation-line-format "On %a, %b %d %Y, %N wrote:\n"
969 "Format of the \"Whomever writes:\" line.
970
971The string is formatted using `format-spec'. The following
972constructs are replaced:
973
974 %f The full From, e.g. \"John Doe <john.doe@example.invalid>\".
975 %n The mail address, e.g. \"john.doe@example.invalid\".
976 %N The real name if present, e.g.: \"John Doe\", else fall
977 back to the mail address.
978 %F The first name if present, e.g.: \"John\".
979 %L The last name if present, e.g.: \"Doe\".
980
981All other format specifiers are passed to `format-time-string'
982which is called using the date from the article your replying to.
983Extracting the first (%F) and last name (%L) is done
984heuristically, so you should always check it yourself.
985
986Please also read the note in the documentation of
987`message-citation-line-function'."
988 :type '(choice (const :tag "Plain" "%f writes:")
989 (const :tag "Include date" "On %a, %b %d %Y, %n wrote:")
990 string)
991 :link '(custom-manual "(message)Insertion Variables")
330f707b 992 :version "23.1" ;; No Gnus
01c52d31
MB
993 :group 'message-insertion)
994
eec82323 995(defcustom message-yank-prefix "> "
23f87bed
MB
996 "*Prefix inserted on the lines of yanked messages.
997Fix `message-cite-prefix-regexp' if it is set to an abnormal value.
01c52d31 998See also `message-yank-cited-prefix' and `message-yank-empty-prefix'."
23f87bed
MB
999 :type 'string
1000 :link '(custom-manual "(message)Insertion Variables")
1001 :group 'message-insertion)
1002
1003(defcustom message-yank-cited-prefix ">"
01c52d31 1004 "*Prefix inserted on cited lines of yanked messages.
23f87bed 1005Fix `message-cite-prefix-regexp' if it is set to an abnormal value.
01c52d31
MB
1006See also `message-yank-prefix' and `message-yank-empty-prefix'."
1007 :version "22.1"
1008 :type 'string
1009 :link '(custom-manual "(message)Insertion Variables")
1010 :group 'message-insertion)
1011
1012(defcustom message-yank-empty-prefix ">"
1013 "*Prefix inserted on empty lines of yanked messages.
1014See also `message-yank-prefix' and `message-yank-cited-prefix'."
bf247b6e 1015 :version "22.1"
eec82323 1016 :type 'string
23f87bed 1017 :link '(custom-manual "(message)Insertion Variables")
eec82323
LMI
1018 :group 'message-insertion)
1019
1020(defcustom message-indentation-spaces 3
1021 "*Number of spaces to insert at the beginning of each cited line.
1022Used by `message-yank-original' via `message-yank-cite'."
1023 :group 'message-insertion
23f87bed 1024 :link '(custom-manual "(message)Insertion Variables")
eec82323
LMI
1025 :type 'integer)
1026
9b3ebcb6 1027(defcustom message-cite-function 'message-cite-original-without-signature
4a55f847
RS
1028 "*Function for citing an original message.
1029Predefined functions include `message-cite-original' and
1030`message-cite-original-without-signature'.
01c52d31 1031Note that these functions use `mail-citation-hook' if that is non-nil."
eec82323 1032 :type '(radio (function-item message-cite-original)
16409b0b 1033 (function-item message-cite-original-without-signature)
eec82323
LMI
1034 (function-item sc-cite-original)
1035 (function :tag "Other"))
23f87bed 1036 :link '(custom-manual "(message)Insertion Variables")
d55fe5bb 1037 :version "22.3" ;; Gnus 5.10.12 (changed default)
eec82323
LMI
1038 :group 'message-insertion)
1039
eec82323
LMI
1040(defcustom message-indent-citation-function 'message-indent-citation
1041 "*Function for modifying a citation just inserted in the mail buffer.
1042This can also be a list of functions. Each function can find the
1043citation between (point) and (mark t). And each function should leave
1044point and mark around the citation text as modified."
1045 :type 'function
23f87bed 1046 :link '(custom-manual "(message)Insertion Variables")
eec82323
LMI
1047 :group 'message-insertion)
1048
eec82323
LMI
1049(defcustom message-signature t
1050 "*String to be inserted at the end of the message buffer.
1051If t, the `message-signature-file' file will be inserted instead.
1052If a function, the result from the function will be used instead.
1053If a form, the result from the form will be used instead."
1054 :type 'sexp
23f87bed 1055 :link '(custom-manual "(message)Insertion Variables")
eec82323
LMI
1056 :group 'message-insertion)
1057
eec82323 1058(defcustom message-signature-file "~/.signature"
5449c317
DL
1059 "*Name of file containing the text inserted at end of message buffer.
1060Ignored if the named file doesn't exist.
01c52d31
MB
1061If nil, don't insert a signature.
1062If a path is specified, the value of `message-signature-directory' is ignored,
1063even if set."
5449c317 1064 :type '(choice file (const :tags "None" nil))
23f87bed
MB
1065 :link '(custom-manual "(message)Insertion Variables")
1066 :group 'message-insertion)
1067
01c52d31
MB
1068(defcustom message-signature-directory nil
1069 "*Name of directory containing signature files.
1070Comes in handy if you have many such files, handled via posting styles for
1071instance.
1072If nil, `message-signature-file' is expected to specify the directory if
1073needed."
1074 :type '(choice string (const :tags "None" nil))
1075 :link '(custom-manual "(message)Insertion Variables")
1076 :group 'message-insertion)
1077
23f87bed
MB
1078(defcustom message-signature-insert-empty-line t
1079 "*If non-nil, insert an empty line before the signature separator."
bf247b6e 1080 :version "22.1"
23f87bed
MB
1081 :type 'boolean
1082 :link '(custom-manual "(message)Insertion Variables")
eec82323
LMI
1083 :group 'message-insertion)
1084
1085(defcustom message-distribution-function nil
1086 "*Function called to return a Distribution header."
1087 :group 'message-news
1088 :group 'message-headers
23f87bed 1089 :link '(custom-manual "(message)News Headers")
7d829636 1090 :type '(choice function (const nil)))
eec82323
LMI
1091
1092(defcustom message-expires 14
1093 "Number of days before your article expires."
1094 :group 'message-news
1095 :group 'message-headers
1096 :link '(custom-manual "(message)News Headers")
1097 :type 'integer)
1098
1099(defcustom message-user-path nil
1100 "If nil, use the NNTP server name in the Path header.
1101If stringp, use this; if non-nil, use no host name (user name only)."
1102 :group 'message-news
1103 :group 'message-headers
1104 :link '(custom-manual "(message)News Headers")
1105 :type '(choice (const :tag "nntp" nil)
1106 (string :tag "name")
1107 (sexp :tag "none" :format "%t" t)))
1108
1109(defvar message-reply-buffer nil)
23f87bed
MB
1110(defvar message-reply-headers nil
1111 "The headers of the current replied article.
1112It is a vector of the following headers:
1113\[number subject from date id references chars lines xref extra].")
eec82323
LMI
1114(defvar message-newsreader nil)
1115(defvar message-mailer nil)
1116(defvar message-sent-message-via nil)
1117(defvar message-checksum nil)
1118(defvar message-send-actions nil
1119 "A list of actions to be performed upon successful sending of a message.")
1120(defvar message-exit-actions nil
1121 "A list of actions to be performed upon exiting after sending a message.")
1122(defvar message-kill-actions nil
1123 "A list of actions to be performed before killing a message buffer.")
1124(defvar message-postpone-actions nil
1125 "A list of actions to be performed after postponing a message.")
1126
6748645f
LMI
1127(define-widget 'message-header-lines 'text
1128 "All header lines must be LFD terminated."
3536d0c1 1129 :format "%{%t%}:%n%v"
6748645f
LMI
1130 :valid-regexp "^\\'"
1131 :error "All header lines must be newline terminated")
1132
eec82323
LMI
1133(defcustom message-default-headers ""
1134 "*A string containing header lines to be inserted in outgoing messages.
1135It is inserted before you edit the message, so you can edit or delete
1136these lines."
1137 :group 'message-headers
23f87bed 1138 :link '(custom-manual "(message)Message Headers")
6748645f 1139 :type 'message-header-lines)
eec82323
LMI
1140
1141(defcustom message-default-mail-headers ""
1142 "*A string of header lines to be inserted in outgoing mails."
1143 :group 'message-headers
1144 :group 'message-mail
23f87bed 1145 :link '(custom-manual "(message)Mail Headers")
6748645f 1146 :type 'message-header-lines)
eec82323
LMI
1147
1148(defcustom message-default-news-headers ""
16409b0b 1149 "*A string of header lines to be inserted in outgoing news articles."
eec82323
LMI
1150 :group 'message-headers
1151 :group 'message-news
23f87bed 1152 :link '(custom-manual "(message)News Headers")
6748645f 1153 :type 'message-header-lines)
eec82323
LMI
1154
1155;; Note: could use /usr/ucb/mail instead of sendmail;
1156;; options -t, and -v if not interactive.
1157(defcustom message-mailer-swallows-blank-line
1158 (if (and (string-match "sparc-sun-sunos\\(\\'\\|[^5]\\)"
1159 system-configuration)
1160 (file-readable-p "/etc/sendmail.cf")
1161 (let ((buffer (get-buffer-create " *temp*")))
1162 (unwind-protect
82816ba1 1163 (with-current-buffer buffer
eec82323
LMI
1164 (insert-file-contents "/etc/sendmail.cf")
1165 (goto-char (point-min))
1166 (let ((case-fold-search nil))
1167 (re-search-forward "^OR\\>" nil t)))
1168 (kill-buffer buffer))))
1169 ;; According to RFC822, "The field-name must be composed of printable
1170 ;; ASCII characters (i. e., characters that have decimal values between
1171 ;; 33 and 126, except colon)", i. e., any chars except ctl chars,
1172 ;; space, or colon.
1173 '(looking-at "[ \t]\\|[][!\"#$%&'()*+,-./0-9;<=>?@A-Z\\\\^_`a-z{|}~]+:"))
6748645f 1174 "*Set this non-nil if the system's mailer runs the header and body together.
eec82323
LMI
1175\(This problem exists on Sunos 4 when sendmail is run in remote mode.)
1176The value should be an expression to test whether the problem will
1177actually occur."
1178 :group 'message-sending
23f87bed 1179 :link '(custom-manual "(message)Mail Variables")
eec82323
LMI
1180 :type 'sexp)
1181
961a48db 1182;;;###autoload
16409b0b
GM
1183(define-mail-user-agent 'message-user-agent
1184 'message-mail 'message-send-and-exit
1185 'message-kill-buffer 'message-send-hook)
eec82323
LMI
1186
1187(defvar message-mh-deletable-headers '(Message-ID Date Lines Sender)
1188 "If non-nil, delete the deletable headers before feeding to mh.")
1189
a8151ef7
LMI
1190(defvar message-send-method-alist
1191 '((news message-news-p message-send-via-news)
1192 (mail message-mail-p message-send-via-mail))
1193 "Alist of ways to send outgoing messages.
1194Each element has the form
1195
1196 \(TYPE PREDICATE FUNCTION)
1197
1198where TYPE is a symbol that names the method; PREDICATE is a function
1199called without any parameters to determine whether the message is
1200a message of type TYPE; and FUNCTION is a function to be called if
1201PREDICATE returns non-nil. FUNCTION is called with one parameter --
1202the prefix.")
1203
c541eb9a 1204(defcustom message-mail-alias-type 'abbrev
a8151ef7 1205 "*What alias expansion type to use in Message buffers.
01c52d31
MB
1206The default is `abbrev', which uses mailabbrev. `ecomplete' uses
1207an electric completion mode. nil switches mail aliases off.
1208This can also be a list of values."
c541eb9a
DL
1209 :group 'message
1210 :link '(custom-manual "(message)Mail Aliases")
1211 :type '(choice (const :tag "Use Mailabbrev" abbrev)
01c52d31 1212 (const :tag "Use ecomplete" ecomplete)
c541eb9a 1213 (const :tag "No expansion" nil)))
a8151ef7 1214
01c52d31
MB
1215(defcustom message-self-insert-commands '(self-insert-command)
1216 "List of `self-insert-command's used to trigger ecomplete.
1217When one of those commands is invoked to enter a character in To or Cc
1218header, ecomplete will suggest the candidates of recipients (see also
1219`message-mail-alias-type'). If you use some tool to enter non-ASCII
1220text and it replaces `self-insert-command' with the other command, e.g.
1221`egg-self-insert-command', you may want to add it to this list."
1222 :group 'message-various
1223 :type '(repeat function))
1224
6748645f 1225(defcustom message-auto-save-directory
8c6f6f4b 1226 (file-name-as-directory (nnheader-concat message-directory "drafts"))
6748645f
LMI
1227 "*Directory where Message auto-saves buffers if Gnus isn't running.
1228If nil, Message won't auto-save."
1229 :group 'message-buffers
23f87bed 1230 :link '(custom-manual "(message)Various Message Variables")
7d829636 1231 :type '(choice directory (const :tag "Don't auto-save" nil)))
6748645f 1232
7d829636 1233(defcustom message-default-charset
83595c0c
DL
1234 (and (not (mm-multibyte-p)) 'iso-8859-1)
1235 "Default charset used in non-MULE Emacsen.
1236If nil, you might be asked to input the charset."
2d447df6 1237 :version "21.1"
16409b0b 1238 :group 'message
23f87bed 1239 :link '(custom-manual "(message)Various Message Variables")
16409b0b
GM
1240 :type 'symbol)
1241
7d829636 1242(defcustom message-dont-reply-to-names
16409b0b 1243 (and (boundp 'rmail-dont-reply-to-names) rmail-dont-reply-to-names)
01c52d31 1244 "*Addresses to prune when doing wide replies.
82816ba1 1245This can be a regexp or a list of regexps. Also, a value of nil means
01c52d31 1246exclude your own user name only."
2d447df6 1247 :version "21.1"
16409b0b 1248 :group 'message
23f87bed 1249 :link '(custom-manual "(message)Wide Reply")
16409b0b 1250 :type '(choice (const :tag "Yourself" nil)
01c52d31
MB
1251 regexp
1252 (repeat :tag "Regexp List" regexp)))
1253
1254(defsubst message-dont-reply-to-names ()
1255 (gmm-regexp-concat message-dont-reply-to-names))
16409b0b 1256
23f87bed
MB
1257(defvar message-shoot-gnksa-feet nil
1258 "*A list of GNKSA feet you are allowed to shoot.
1259Gnus gives you all the opportunity you could possibly want for
1260shooting yourself in the foot. Also, Gnus allows you to shoot the
1261feet of Good Net-Keeping Seal of Approval. The following are foot
1262candidates:
1263`empty-article' Allow you to post an empty article;
1264`quoted-text-only' Allow you to post quoted text only;
1265`multiple-copies' Allow you to post multiple copies;
1266`cancel-messages' Allow you to cancel or supersede messages from
01c52d31 1267 your other email addresses.")
23f87bed
MB
1268
1269(defsubst message-gnksa-enable-p (feature)
1270 (or (not (listp message-shoot-gnksa-feet))
1271 (memq feature message-shoot-gnksa-feet)))
1272
01c52d31
MB
1273(defcustom message-hidden-headers '("^References:" "^Face:" "^X-Face:"
1274 "^X-Draft-From:")
23f87bed
MB
1275 "Regexp of headers to be hidden when composing new messages.
1276This can also be a list of regexps to match headers. Or a list
1277starting with `not' and followed by regexps."
bf247b6e 1278 :version "22.1"
23f87bed
MB
1279 :group 'message
1280 :link '(custom-manual "(message)Message Headers")
01c52d31
MB
1281 :type '(choice
1282 :format "%{%t%}: %[Value Type%] %v"
1283 (regexp :menu-tag "regexp" :format "regexp\n%t: %v")
1284 (repeat :menu-tag "(regexp ...)" :format "(regexp ...)\n%v%i"
1285 (regexp :format "%t: %v"))
1286 (cons :menu-tag "(not regexp ...)" :format "(not regexp ...)\n%v"
1287 (const not)
1288 (repeat :format "%v%i"
1289 (regexp :format "%t: %v")))))
1290
1291(defcustom message-cite-articles-with-x-no-archive t
1292 "If non-nil, cite text from articles that has X-No-Archive set."
1293 :group 'message
1294 :type 'boolean)
23f87bed 1295
eec82323
LMI
1296;;; Internal variables.
1297;;; Well, not really internal.
1298
1299(defvar message-mode-syntax-table
1300 (let ((table (copy-syntax-table text-mode-syntax-table)))
1301 (modify-syntax-entry ?% ". " table)
16409b0b
GM
1302 (modify-syntax-entry ?> ". " table)
1303 (modify-syntax-entry ?< ". " table)
eec82323
LMI
1304 table)
1305 "Syntax table used while in Message mode.")
1306
0f49874b 1307(defface message-header-to
eec82323
LMI
1308 '((((class color)
1309 (background dark))
01c52d31 1310 (:foreground "DarkOliveGreen1" :bold t))
eec82323
LMI
1311 (((class color)
1312 (background light))
23f87bed 1313 (:foreground "MidnightBlue" :bold t))
eec82323 1314 (t
23f87bed 1315 (:bold t :italic t)))
eec82323
LMI
1316 "Face used for displaying From headers."
1317 :group 'message-faces)
0f49874b
MB
1318;; backward-compatibility alias
1319(put 'message-header-to-face 'face-alias 'message-header-to)
3d493bef 1320(put 'message-header-to-face 'obsolete-face "22.1")
eec82323 1321
0f49874b 1322(defface message-header-cc
eec82323
LMI
1323 '((((class color)
1324 (background dark))
01c52d31 1325 (:foreground "chartreuse1" :bold t))
eec82323
LMI
1326 (((class color)
1327 (background light))
1328 (:foreground "MidnightBlue"))
1329 (t
23f87bed 1330 (:bold t)))
eec82323
LMI
1331 "Face used for displaying Cc headers."
1332 :group 'message-faces)
0f49874b
MB
1333;; backward-compatibility alias
1334(put 'message-header-cc-face 'face-alias 'message-header-cc)
3d493bef 1335(put 'message-header-cc-face 'obsolete-face "22.1")
eec82323 1336
0f49874b 1337(defface message-header-subject
eec82323
LMI
1338 '((((class color)
1339 (background dark))
01c52d31 1340 (:foreground "OliveDrab1"))
eec82323
LMI
1341 (((class color)
1342 (background light))
23f87bed 1343 (:foreground "navy blue" :bold t))
eec82323 1344 (t
23f87bed 1345 (:bold t)))
eec82323
LMI
1346 "Face used for displaying subject headers."
1347 :group 'message-faces)
0f49874b
MB
1348;; backward-compatibility alias
1349(put 'message-header-subject-face 'face-alias 'message-header-subject)
3d493bef 1350(put 'message-header-subject-face 'obsolete-face "22.1")
eec82323 1351
0f49874b 1352(defface message-header-newsgroups
eec82323
LMI
1353 '((((class color)
1354 (background dark))
23f87bed 1355 (:foreground "yellow" :bold t :italic t))
eec82323
LMI
1356 (((class color)
1357 (background light))
23f87bed 1358 (:foreground "blue4" :bold t :italic t))
eec82323 1359 (t
23f87bed 1360 (:bold t :italic t)))
eec82323
LMI
1361 "Face used for displaying newsgroups headers."
1362 :group 'message-faces)
0f49874b
MB
1363;; backward-compatibility alias
1364(put 'message-header-newsgroups-face 'face-alias 'message-header-newsgroups)
3d493bef 1365(put 'message-header-newsgroups-face 'obsolete-face "22.1")
eec82323 1366
0f49874b 1367(defface message-header-other
eec82323
LMI
1368 '((((class color)
1369 (background dark))
01c52d31 1370 (:foreground "VioletRed1"))
eec82323
LMI
1371 (((class color)
1372 (background light))
1373 (:foreground "steel blue"))
1374 (t
23f87bed 1375 (:bold t :italic t)))
eec82323
LMI
1376 "Face used for displaying newsgroups headers."
1377 :group 'message-faces)
0f49874b
MB
1378;; backward-compatibility alias
1379(put 'message-header-other-face 'face-alias 'message-header-other)
3d493bef 1380(put 'message-header-other-face 'obsolete-face "22.1")
eec82323 1381
0f49874b 1382(defface message-header-name
eec82323
LMI
1383 '((((class color)
1384 (background dark))
01c52d31 1385 (:foreground "green"))
eec82323
LMI
1386 (((class color)
1387 (background light))
1388 (:foreground "cornflower blue"))
1389 (t
23f87bed 1390 (:bold t)))
eec82323
LMI
1391 "Face used for displaying header names."
1392 :group 'message-faces)
0f49874b
MB
1393;; backward-compatibility alias
1394(put 'message-header-name-face 'face-alias 'message-header-name)
3d493bef 1395(put 'message-header-name-face 'obsolete-face "22.1")
eec82323 1396
0f49874b 1397(defface message-header-xheader
eec82323
LMI
1398 '((((class color)
1399 (background dark))
01c52d31 1400 (:foreground "DeepSkyBlue1"))
eec82323
LMI
1401 (((class color)
1402 (background light))
1403 (:foreground "blue"))
1404 (t
23f87bed 1405 (:bold t)))
eec82323
LMI
1406 "Face used for displaying X-Header headers."
1407 :group 'message-faces)
0f49874b
MB
1408;; backward-compatibility alias
1409(put 'message-header-xheader-face 'face-alias 'message-header-xheader)
3d493bef 1410(put 'message-header-xheader-face 'obsolete-face "22.1")
eec82323 1411
0f49874b 1412(defface message-separator
eec82323
LMI
1413 '((((class color)
1414 (background dark))
01c52d31 1415 (:foreground "LightSkyBlue1"))
eec82323
LMI
1416 (((class color)
1417 (background light))
1418 (:foreground "brown"))
1419 (t
23f87bed 1420 (:bold t)))
eec82323
LMI
1421 "Face used for displaying the separator."
1422 :group 'message-faces)
0f49874b
MB
1423;; backward-compatibility alias
1424(put 'message-separator-face 'face-alias 'message-separator)
3d493bef 1425(put 'message-separator-face 'obsolete-face "22.1")
eec82323 1426
0f49874b 1427(defface message-cited-text
eec82323
LMI
1428 '((((class color)
1429 (background dark))
01c52d31 1430 (:foreground "LightPink1"))
eec82323
LMI
1431 (((class color)
1432 (background light))
1433 (:foreground "red"))
1434 (t
23f87bed 1435 (:bold t)))
eec82323
LMI
1436 "Face used for displaying cited text names."
1437 :group 'message-faces)
0f49874b
MB
1438;; backward-compatibility alias
1439(put 'message-cited-text-face 'face-alias 'message-cited-text)
3d493bef 1440(put 'message-cited-text-face 'obsolete-face "22.1")
eec82323 1441
0f49874b 1442(defface message-mml
16409b0b
GM
1443 '((((class color)
1444 (background dark))
01c52d31 1445 (:foreground "MediumSpringGreen"))
16409b0b
GM
1446 (((class color)
1447 (background light))
1448 (:foreground "ForestGreen"))
1449 (t
23f87bed 1450 (:bold t)))
16409b0b
GM
1451 "Face used for displaying MML."
1452 :group 'message-faces)
0f49874b
MB
1453;; backward-compatibility alias
1454(put 'message-mml-face 'face-alias 'message-mml)
3d493bef 1455(put 'message-mml-face 'obsolete-face "22.1")
16409b0b 1456
23f87bed
MB
1457(defun message-font-lock-make-header-matcher (regexp)
1458 (let ((form
1459 `(lambda (limit)
1460 (let ((start (point)))
1461 (save-restriction
1462 (widen)
1463 (goto-char (point-min))
1464 (if (re-search-forward
1465 (concat "^" (regexp-quote mail-header-separator) "$")
1466 nil t)
1467 (setq limit (min limit (match-beginning 0))))
1468 (goto-char start))
1469 (and (< start limit)
1470 (re-search-forward ,regexp limit t))))))
1471 (if (featurep 'bytecomp)
1472 (byte-compile form)
1473 form)))
1474
eec82323 1475(defvar message-font-lock-keywords
23f87bed
MB
1476 (let ((content "[ \t]*\\(.+\\(\n[ \t].*\\)*\\)\n?"))
1477 `((,(message-font-lock-make-header-matcher
1478 (concat "^\\([Tt]o:\\)" content))
0f49874b
MB
1479 (1 'message-header-name)
1480 (2 'message-header-to nil t))
23f87bed
MB
1481 (,(message-font-lock-make-header-matcher
1482 (concat "^\\(^[GBF]?[Cc][Cc]:\\|^[Rr]eply-[Tt]o:\\)" content))
0f49874b
MB
1483 (1 'message-header-name)
1484 (2 'message-header-cc nil t))
23f87bed
MB
1485 (,(message-font-lock-make-header-matcher
1486 (concat "^\\([Ss]ubject:\\)" content))
0f49874b
MB
1487 (1 'message-header-name)
1488 (2 'message-header-subject nil t))
23f87bed
MB
1489 (,(message-font-lock-make-header-matcher
1490 (concat "^\\([Nn]ewsgroups:\\|Followup-[Tt]o:\\)" content))
0f49874b
MB
1491 (1 'message-header-name)
1492 (2 'message-header-newsgroups nil t))
23f87bed 1493 (,(message-font-lock-make-header-matcher
01c52d31 1494 (concat "^\\(X-[A-Za-z0-9-]+:\\|In-Reply-To:\\)" content))
0f49874b 1495 (1 'message-header-name)
01c52d31 1496 (2 'message-header-xheader))
23f87bed 1497 (,(message-font-lock-make-header-matcher
01c52d31 1498 (concat "^\\([A-Z][^: \n\t]+:\\)" content))
0f49874b 1499 (1 'message-header-name)
01c52d31 1500 (2 'message-header-other nil t))
6748645f
LMI
1501 ,@(if (and mail-header-separator
1502 (not (equal mail-header-separator "")))
1503 `((,(concat "^\\(" (regexp-quote mail-header-separator) "\\)$")
0f49874b 1504 1 'message-separator))
6748645f 1505 nil)
23f87bed
MB
1506 ((lambda (limit)
1507 (re-search-forward (concat "^\\("
1508 message-cite-prefix-regexp
1509 "\\).*")
1510 limit t))
0f49874b 1511 (0 'message-cited-text))
23f87bed 1512 ("<#/?\\(multipart\\|part\\|external\\|mml\\|secure\\)[^>]*>"
0f49874b 1513 (0 'message-mml))))
eec82323
LMI
1514 "Additional expressions to highlight in Message mode.")
1515
23f87bed 1516
6748645f
LMI
1517;; XEmacs does it like this. For Emacs, we have to set the
1518;; `font-lock-defaults' buffer-local variable.
1519(put 'message-mode 'font-lock-defaults '(message-font-lock-keywords t))
1520
eec82323 1521(defvar message-face-alist
01c52d31 1522 '((bold . message-bold-region)
eec82323
LMI
1523 (underline . underline-region)
1524 (default . (lambda (b e)
01c52d31 1525 (message-unbold-region b e)
eec82323
LMI
1526 (ununderline-region b e))))
1527 "Alist of mail and news faces for facemenu.
8f688cb0 1528The cdr of each entry is a function for applying the face to a region.")
eec82323
LMI
1529
1530(defcustom message-send-hook nil
23f87bed
MB
1531 "Hook run before sending messages.
1532This hook is run quite early when sending."
eec82323
LMI
1533 :group 'message-various
1534 :options '(ispell-message)
23f87bed 1535 :link '(custom-manual "(message)Various Message Variables")
eec82323
LMI
1536 :type 'hook)
1537
1538(defcustom message-send-mail-hook nil
23f87bed
MB
1539 "Hook run before sending mail messages.
1540This hook is run very late -- just before the message is sent as
1541mail."
eec82323 1542 :group 'message-various
23f87bed 1543 :link '(custom-manual "(message)Various Message Variables")
eec82323
LMI
1544 :type 'hook)
1545
1546(defcustom message-send-news-hook nil
23f87bed
MB
1547 "Hook run before sending news messages.
1548This hook is run very late -- just before the message is sent as
1549news."
eec82323 1550 :group 'message-various
23f87bed 1551 :link '(custom-manual "(message)Various Message Variables")
eec82323
LMI
1552 :type 'hook)
1553
1554(defcustom message-sent-hook nil
1555 "Hook run after sending messages."
1556 :group 'message-various
1557 :type 'hook)
1558
6748645f
LMI
1559(defvar message-send-coding-system 'binary
1560 "Coding system to encode outgoing mail.")
1561
16409b0b
GM
1562(defvar message-draft-coding-system
1563 mm-auto-save-coding-system
23f87bed
MB
1564 "*Coding system to compose mail.
1565If you'd like to make it possible to share draft files between XEmacs
1566and Emacs, you may use `iso-2022-7bit' for this value at your own risk.
1567Note that the coding-system `iso-2022-7bit' isn't suitable to all data.")
16409b0b
GM
1568
1569(defcustom message-send-mail-partially-limit 1000000
1570 "The limitation of messages sent as message/partial.
7d829636
DL
1571The lower bound of message size in characters, beyond which the message
1572should be sent in several parts. If it is nil, the size is unlimited."
2d447df6 1573 :version "21.1"
16409b0b 1574 :group 'message-buffers
23f87bed 1575 :link '(custom-manual "(message)Mail Variables")
16409b0b
GM
1576 :type '(choice (const :tag "unlimited" nil)
1577 (integer 1000000)))
1578
83595c0c 1579(defcustom message-alternative-emails nil
46e8fe3d
MB
1580 "*Regexp matching alternative email addresses.
1581The first address in the To, Cc or From headers of the original
1582article matching this variable is used as the From field of
1583outgoing messages.
1584
1585This variable has precedence over posting styles and anything that runs
1586off `message-setup-hook'."
83595c0c 1587 :group 'message-headers
23f87bed 1588 :link '(custom-manual "(message)Message Headers")
83595c0c
DL
1589 :type '(choice (const :tag "Always use primary" nil)
1590 regexp))
1591
23f87bed
MB
1592(defcustom message-hierarchical-addresses nil
1593 "A list of hierarchical mail address definitions.
1594
1595Inside each entry, the first address is the \"top\" address, and
1596subsequent addresses are subaddresses; this is used to indicate that
1597mail sent to the first address will automatically be delivered to the
1598subaddresses. So if the first address appears in the recipient list
1599for a message, the subaddresses will be removed (if present) before
1600the mail is sent. All addresses in this structure should be
1601downcased."
bf247b6e 1602 :version "22.1"
23f87bed
MB
1603 :group 'message-headers
1604 :type '(repeat (repeat string)))
1605
88818fbe
SZ
1606(defcustom message-mail-user-agent nil
1607 "Like `mail-user-agent'.
7d829636 1608Except if it is nil, use Gnus native MUA; if it is t, use
88818fbe 1609`mail-user-agent'."
bf247b6e 1610 :version "22.1"
88818fbe
SZ
1611 :type '(radio (const :tag "Gnus native"
1612 :format "%t\n"
1613 nil)
1614 (const :tag "`mail-user-agent'"
1615 :format "%t\n"
1616 t)
1617 (function-item :tag "Default Emacs mail"
1618 :format "%t\n"
1619 sendmail-user-agent)
1620 (function-item :tag "Emacs interface to MH"
1621 :format "%t\n"
1622 mh-e-user-agent)
1623 (function :tag "Other"))
1624 :version "21.1"
1625 :group 'message)
1626
23f87bed
MB
1627(defcustom message-wide-reply-confirm-recipients nil
1628 "Whether to confirm a wide reply to multiple email recipients.
1629If this variable is nil, don't ask whether to reply to all recipients.
1630If this variable is non-nil, pose the question \"Reply to all
1631recipients?\" before a wide reply to multiple recipients. If the user
1632answers yes, reply to all recipients as usual. If the user answers
1633no, only reply back to the author."
bf247b6e 1634 :version "22.1"
23f87bed
MB
1635 :group 'message-headers
1636 :link '(custom-manual "(message)Wide Reply")
1637 :type 'boolean)
1638
1639(defcustom message-user-fqdn nil
bcc7dd61 1640 "*Domain part of Message-Ids."
bf247b6e 1641 :version "22.1"
23f87bed
MB
1642 :group 'message-headers
1643 :link '(custom-manual "(message)News Headers")
1644 :type '(radio (const :format "%v " nil)
ad136a7c 1645 (string :format "FQDN: %v")))
23f87bed
MB
1646
1647(defcustom message-use-idna (and (condition-case nil (require 'idna)
1648 (file-error))
1649 (mm-coding-system-p 'utf-8)
1650 (executable-find idna-program)
a33704bb
MB
1651