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