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