1 ;;; message.el --- composing mail and news messages
3 ;; Copyright (C) 1996-2014 Free Software Foundation, Inc.
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;; Keywords: mail, news
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software: you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation, either version 3 of the License, or
13 ;; (at your option) any later version.
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;; This mode provides mail-sending facilities from within Emacs. It
26 ;; consists mainly of large chunks of code from the sendmail.el,
27 ;; gnus-msg.el and rnewspost.el files.
37 ;; Only for the trivial macros mail-header-from, mail-header-date
38 ;; mail-header-references, mail-header-subject, mail-header-id
39 (eval-when-compile (require 'nnheader))
40 ;; This is apparently necessary even though things are autoloaded.
41 ;; Because we dynamically bind mail-abbrev-mode-regexp, we'd better
42 ;; require mailabbrev here.
43 (if (featurep 'xemacs)
44 (require 'mail-abbrevs)
45 (require 'mailabbrev))
49 (require 'format-spec)
52 (autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
54 (defvar gnus-message-group-art)
55 (defvar gnus-list-identifiers) ; gnus-sum is required where necessary
56 (defvar rmail-enable-mime-composing)
58 (defgroup message '((user-mail-address custom-variable)
59 (user-full-name custom-variable))
60 "Mail and news message composing."
61 :link '(custom-manual "(message)Top")
65 (put 'user-mail-address 'custom-type 'string)
66 (put 'user-full-name 'custom-type 'string)
68 (defgroup message-various nil
69 "Various Message Variables."
70 :link '(custom-manual "(message)Various Message Variables")
73 (defgroup message-buffers nil
75 :link '(custom-manual "(message)Message Buffers")
78 (defgroup message-sending nil
80 :link '(custom-manual "(message)Sending Variables")
83 (defgroup message-interface nil
85 :link '(custom-manual "(message)Interface")
88 (defgroup message-forwarding nil
90 :link '(custom-manual "(message)Forwarding")
91 :group 'message-interface)
93 (defgroup message-insertion nil
95 :link '(custom-manual "(message)Insertion")
98 (defgroup message-headers nil
100 :link '(custom-manual "(message)Message Headers")
103 (defgroup message-news nil
104 "Composing News Messages."
107 (defgroup message-mail nil
108 "Composing Mail Messages."
111 (defgroup message-faces nil
112 "Faces used for message composing."
116 (defcustom message-directory "~/Mail/"
117 "*Directory from which all other mail file variables are derived."
118 :group 'message-various
121 (defcustom message-max-buffers 10
122 "*How many buffers to keep before starting to kill them off."
123 :group 'message-buffers
126 (defcustom message-send-rename-function nil
127 "Function called to rename the buffer after sending it."
128 :group 'message-buffers
129 :type '(choice function (const nil)))
131 (defcustom message-fcc-handler-function 'message-output
132 "*A function called to save outgoing articles.
133 This function will be called with the name of the file to store the
134 article in. The default function is `message-output' which saves in Unix
136 :type '(radio (function-item message-output)
137 (function :tag "Other"))
138 :group 'message-sending)
140 (defcustom message-fcc-externalize-attachments nil
141 "If non-nil, attachments are included as external parts in Fcc copies."
144 :group 'message-sending)
146 (defcustom message-courtesy-message
147 "The following message is a courtesy copy of an article\nthat has been posted to %s as well.\n\n"
148 "*This is inserted at the start of a mailed copy of a posted message.
149 If the string contains the format spec \"%s\", the Newsgroups
150 the article has been posted to will be inserted there.
151 If this variable is nil, no such courtesy message will be added."
152 :group 'message-sending
153 :type '(radio string (const nil)))
155 (defcustom message-ignored-bounced-headers
156 "^\\(Received\\|Return-Path\\|Delivered-To\\):"
157 "*Regexp that matches headers to be removed in resent bounced mail."
158 :group 'message-interface
161 (defcustom message-from-style 'default
162 ;; In Emacs 24.1 this defaults to the value of `mail-from-style'
164 ;; `angles' in Emacs 22.1~23.1, XEmacs 21.4, 21.5, and SXEmacs 22.1;
165 ;; `system-default' in Emacs 23.2, and 24.1
166 "Specifies how \"From\" headers look.
168 If nil, they contain just the return address like:
170 If `parens', they look like:
171 king@grassland.com (Elvis Parsley)
172 If `angles', they look like:
173 Elvis Parsley <king@grassland.com>
175 Otherwise, most addresses look like `angles', but they look like
176 `parens' if `angles' would need quoting and `parens' would not."
178 :type '(choice (const :tag "simple" nil)
182 :group 'message-headers)
184 (defcustom message-insert-canlock t
185 "Whether to insert a Cancel-Lock header in news postings."
187 :group 'message-headers
190 (defcustom message-syntax-checks
191 (if message-insert-canlock '((sender . disabled)) nil)
192 ;; Guess this one shouldn't be easy to customize...
193 "*Controls what syntax checks should not be performed on outgoing posts.
194 To disable checking of long signatures, for instance, add
195 `(signature . disabled)' to this list.
197 Don't touch this variable unless you really know what you're doing.
199 Checks include `approved', `bogus-recipient', `continuation-headers',
200 `control-chars', `empty', `existing-newsgroups', `from', `illegible-text',
201 `invisible-text', `long-header-lines', `long-lines', `message-id',
202 `multiple-headers', `new-text', `newsgroups', `quoting-style',
203 `repeated-newsgroups', `reply-to', `sender', `sendsys', `shoot',
204 `shorten-followup-to', `signature', `size', `subject', `subject-cmsg'
205 and `valid-newsgroups'."
207 :type '(repeat sexp)) ; Fixme: improve this
209 (defcustom message-required-headers '((optional . References)
211 "*Headers to be generated or prompted for when sending a message.
212 Also see `message-required-news-headers' and
213 `message-required-mail-headers'."
216 :group 'message-headers
217 :link '(custom-manual "(message)Message Headers")
218 :type '(repeat sexp))
220 (defcustom message-draft-headers '(References From Date)
221 "*Headers to be generated when saving a draft message."
224 :group 'message-headers
225 :link '(custom-manual "(message)Message Headers")
226 :type '(repeat sexp))
228 (defcustom message-required-news-headers
229 '(From Newsgroups Subject Date Message-ID
230 (optional . Organization)
231 (optional . User-Agent))
232 "*Headers to be generated or prompted for when posting an article.
233 RFC977 and RFC1036 require From, Date, Newsgroups, Subject,
234 Message-ID. Organization, Lines, In-Reply-To, Expires, and
235 User-Agent are optional. If you don't want message to insert some
236 header, remove it from this list."
238 :group 'message-headers
239 :link '(custom-manual "(message)Message Headers")
240 :type '(repeat sexp))
242 (defcustom message-required-mail-headers
243 '(From Subject Date (optional . In-Reply-To) Message-ID
244 (optional . User-Agent))
245 "*Headers to be generated or prompted for when mailing a message.
246 It is recommended that From, Date, To, Subject and Message-ID be
247 included. Organization and User-Agent are optional."
249 :group 'message-headers
250 :link '(custom-manual "(message)Message Headers")
251 :type '(repeat sexp))
253 (defcustom message-prune-recipient-rules nil
254 "Rules for how to prune the list of recipients when doing wide replies.
255 This is a list of regexps and regexp matches."
258 :group 'message-headers
259 :link '(custom-manual "(message)Wide Reply")
260 :type '(repeat regexp))
262 (defcustom message-deletable-headers '(Message-ID Date Lines)
263 "Headers to be deleted if they already exist and were generated by message previously."
264 :group 'message-headers
265 :link '(custom-manual "(message)Message Headers")
268 (defcustom message-ignored-news-headers
269 "^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:\\|^X-Message-SMTP-Method:\\|^X-Gnus-Delayed:"
270 "*Regexp of headers to be removed unconditionally before posting."
272 :group 'message-headers
273 :link '(custom-manual "(message)Message Headers")
274 :type '(repeat :value-to-internal (lambda (widget value)
275 (custom-split-regexp-maybe value))
276 :match (lambda (widget value)
278 (widget-editable-list-match widget value)))
281 (defcustom message-ignored-mail-headers
282 "^\\([GF]cc\\|Resent-Fcc\\|Xref\\|X-Draft-From\\|X-Gnus-Agent-Meta-Information\\):"
283 "*Regexp of headers to be removed unconditionally before mailing."
285 :group 'message-headers
286 :link '(custom-manual "(message)Mail Headers")
289 (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:"
290 "*Header lines matching this regexp will be deleted before posting.
291 It's best to delete old Path and Date headers before posting to avoid
293 :group 'message-interface
294 :link '(custom-manual "(message)Superseding")
295 :type '(repeat :value-to-internal (lambda (widget value)
296 (custom-split-regexp-maybe value))
297 :match (lambda (widget value)
299 (widget-editable-list-match widget value)))
302 (defcustom message-subject-re-regexp
303 "^[ \t]*\\([Rr][Ee]\\(\\[[0-9]*\\]\\)*:[ \t]*\\)*[ \t]*"
304 "*Regexp matching \"Re: \" in the subject line."
305 :group 'message-various
306 :link '(custom-manual "(message)Message Headers")
309 ;;; Start of variables adopted from `message-utils.el'.
311 (defcustom message-subject-trailing-was-query t
312 "*What to do with trailing \"(was: <old subject>)\" in subject lines.
313 If nil, leave the subject unchanged. If it is the symbol `ask', query
314 the user what do do. In this case, the subject is matched against
315 `message-subject-trailing-was-ask-regexp'. If
316 `message-subject-trailing-was-query' is t, always strip the trailing
317 old subject. In this case, `message-subject-trailing-was-regexp' is
320 :type '(choice (const :tag "never" nil)
321 (const :tag "always strip" t)
323 :link '(custom-manual "(message)Message Headers")
324 :group 'message-various)
326 (defcustom message-subject-trailing-was-ask-regexp
327 "[ \t]*\\([[(]+[Ww][Aa][Ss]:?[ \t]*.*[])]+\\)"
328 "*Regexp matching \"(was: <old subject>)\" in the subject line.
330 The function `message-strip-subject-trailing-was' uses this regexp if
331 `message-subject-trailing-was-query' is set to the symbol `ask'. If
332 the variable is t instead of `ask', use
333 `message-subject-trailing-was-regexp' instead.
335 It is okay to create some false positives here, as the user is asked."
337 :group 'message-various
338 :link '(custom-manual "(message)Message Headers")
341 (defcustom message-subject-trailing-was-regexp
342 "[ \t]*\\((*[Ww][Aa][Ss]:[ \t]*.*)\\)"
343 "*Regexp matching \"(was: <old subject>)\" in the subject line.
345 If `message-subject-trailing-was-query' is set to t, the subject is
346 matched against `message-subject-trailing-was-regexp' in
347 `message-strip-subject-trailing-was'. You should use a regexp creating very
348 few false positives here."
350 :group 'message-various
351 :link '(custom-manual "(message)Message Headers")
354 ;;; marking inserted text
356 (defcustom message-mark-insert-begin
357 "--8<---------------cut here---------------start------------->8---\n"
358 "How to mark the beginning of some inserted text."
361 :link '(custom-manual "(message)Insertion Variables")
362 :group 'message-various)
364 (defcustom message-mark-insert-end
365 "--8<---------------cut here---------------end--------------->8---\n"
366 "How to mark the end of some inserted text."
369 :link '(custom-manual "(message)Insertion Variables")
370 :group 'message-various)
372 (defcustom message-archive-header "X-No-Archive: Yes\n"
373 "Header to insert when you don't want your article to be archived.
374 Archives \(such as groups.google.com\) respect this header."
377 :link '(custom-manual "(message)Header Commands")
378 :group 'message-various)
380 (defcustom message-archive-note
381 "X-No-Archive: Yes - save http://groups.google.com/"
382 "Note to insert why you wouldn't want this posting archived.
383 If nil, don't insert any text in the body."
385 :type '(radio string (const nil))
386 :link '(custom-manual "(message)Header Commands")
387 :group 'message-various)
389 ;;; Crossposts and Followups
390 ;; inspired by JoH-followup-to by Jochem Huhman <joh at gmx.de>
391 ;; new suggestions by R. Weikusat <rw at another.de>
393 (defvar message-cross-post-old-target nil
394 "Old target for cross-posts or follow-ups.")
395 (make-variable-buffer-local 'message-cross-post-old-target)
397 (defcustom message-cross-post-default t
398 "When non-nil `message-cross-post-followup-to' will perform a crosspost.
399 If nil, `message-cross-post-followup-to' will only do a followup. Note that
400 you can explicitly override this setting by calling
401 `message-cross-post-followup-to' with a prefix."
404 :group 'message-various)
406 (defcustom message-cross-post-note "Crosspost & Followup-To: "
407 "Note to insert before signature to notify of cross-post and follow-up."
410 :group 'message-various)
412 (defcustom message-followup-to-note "Followup-To: "
413 "Note to insert before signature to notify of follow-up only."
416 :group 'message-various)
418 (defcustom message-cross-post-note-function 'message-cross-post-insert-note
419 "Function to use to insert note about Crosspost or Followup-To.
420 The function will be called with four arguments. The function should not only
421 insert a note, but also ensure old notes are deleted. See the documentation
422 for `message-cross-post-insert-note'."
425 :group 'message-various)
427 ;;; End of variables adopted from `message-utils.el'.
429 (defcustom message-signature-separator "^-- $"
430 "Regexp matching the signature separator.
431 This variable is used to strip off the signature from quoted text
432 when `message-cite-function' is
433 `message-cite-original-without-signature'. Most useful values
434 are \"^-- $\" (strict) and \"^-- *$\" (loose; allow missing
436 :type '(choice (const :tag "strict" "^-- $")
437 (const :tag "loose" "^-- *$")
439 :version "22.3" ;; Gnus 5.10.12 (changed default)
440 :link '(custom-manual "(message)Various Message Variables")
441 :group 'message-various)
443 (defcustom message-elide-ellipsis "\n[...]\n\n"
444 "*The string which is inserted for elided text.
445 This is a format-spec string, and you can use %l to say how many
446 lines were removed, and %c to say how many characters were
449 :link '(custom-manual "(message)Various Commands")
450 :group 'message-various)
452 (defcustom message-interactive t
453 ;; In Emacs 24.1 this defaults to the value of `mail-interactive'
455 ;; `nil' in Emacs 22.1~22.3, XEmacs 21.4, 21.5, and SXEmacs 22.1;
456 ;; `t' in Emacs 23.1~24.1
457 "Non-nil means when sending a message wait for and display errors.
458 A value of nil means let mailer mail back a message to report errors."
460 :group 'message-sending
462 :link '(custom-manual "(message)Sending Variables")
465 (defcustom message-confirm-send nil
466 "When non-nil, ask for confirmation when sending a message."
467 :group 'message-sending
469 :version "23.1" ;; No Gnus
470 :link '(custom-manual "(message)Sending Variables")
473 (defcustom message-generate-new-buffers 'unsent
474 "*Say whether to create a new message buffer to compose a message.
475 Valid values include:
478 Generate the buffer name in the Message way (e.g., *mail*, *news*,
479 *mail to whom*, *news on group*, etc.) and continue editing in the
480 existing buffer of that name. If there is no such buffer, it will
484 Create the new buffer with the name generated in the Message way.
487 Similar to `unique' but the buffer name begins with \"*unsent \".
490 Similar to nil but the buffer name is simpler like *mail message*.
493 If this is a function, call that function with three parameters:
494 The type, the To address and the group name (any of these may be nil).
495 The function should return the new buffer name."
497 :group 'message-buffers
498 :link '(custom-manual "(message)Message Buffers")
499 :type '(choice (const nil)
500 (sexp :tag "unique" :format "unique\n" :value unique
501 :match (lambda (widget value) (memq value '(unique t))))
504 (function :format "\n %{%t%}: %v")))
506 (defcustom message-kill-buffer-on-exit nil
507 "*Non-nil means that the message buffer will be killed after sending a message."
508 :group 'message-buffers
509 :link '(custom-manual "(message)Message Buffers")
512 (defcustom message-kill-buffer-query t
513 "*Non-nil means that killing a modified message buffer has to be confirmed.
514 This is used by `message-kill-buffer'."
515 :version "23.1" ;; No Gnus
516 :group 'message-buffers
519 (defcustom message-user-organization
520 (or (getenv "ORGANIZATION") t)
521 "String to be used as an Organization header.
522 If t, use `message-user-organization-file'."
523 :group 'message-headers
524 :type '(choice string
525 (const :tag "consult file" t)))
527 (defcustom message-user-organization-file
529 (dolist (f (list "/etc/organization"
530 "/etc/news/organization"
531 "/usr/lib/news/organization"))
532 (when (file-readable-p f)
535 "*Local news organization file."
536 :type '(choice (const nil) file)
537 :link '(custom-manual "(message)News Headers")
538 :group 'message-headers)
540 (defcustom message-make-forward-subject-function
541 #'message-forward-subject-name-subject
542 "*List of functions called to generate subject headers for forwarded messages.
543 The subject generated by the previous function is passed into each
546 The provided functions are:
548 * `message-forward-subject-author-subject' Source of article (author or
549 newsgroup), in brackets followed by the subject
550 * `message-forward-subject-name-subject' Source of article (name of author
551 or newsgroup), in brackets followed by the subject
552 * `message-forward-subject-fwd' Subject of article with 'Fwd:' prepended
554 :group 'message-forwarding
555 :link '(custom-manual "(message)Forwarding")
556 :type '(radio (function-item message-forward-subject-author-subject)
557 (function-item message-forward-subject-fwd)
558 (function-item message-forward-subject-name-subject)
559 (repeat :tag "List of functions" function)))
561 (defcustom message-forward-as-mime t
562 "*Non-nil means forward messages as an inline/rfc822 MIME section.
563 Otherwise, directly inline the old message in the forwarded message."
565 :group 'message-forwarding
566 :link '(custom-manual "(message)Forwarding")
569 (defcustom message-forward-show-mml 'best
570 "*Non-nil means show forwarded messages as MML (decoded from MIME).
571 Otherwise, forwarded messages are unchanged.
572 Can also be the symbol `best' to indicate that MML should be
573 used, except when it is a bad idea to use MML. One example where
574 it is a bad idea is when forwarding a signed or encrypted
575 message, because converting MIME to MML would invalidate the
578 :group 'message-forwarding
579 :type '(choice (const :tag "use MML" t)
580 (const :tag "don't use MML " nil)
581 (const :tag "use MML when appropriate" best)))
583 (defcustom message-forward-before-signature t
584 "*Non-nil means put forwarded message before signature, else after."
585 :group 'message-forwarding
588 (defcustom message-wash-forwarded-subjects nil
589 "*Non-nil means try to remove as much cruft as possible from the subject.
590 Done before generating the new subject of a forward."
591 :group 'message-forwarding
592 :link '(custom-manual "(message)Forwarding")
595 (defcustom message-ignored-resent-headers
596 ;; `Delivered-To' needs to be removed because some mailers use it to
597 ;; detect loops, so if you resend a message to an address that ultimately
598 ;; comes back to you (e.g. a mailing-list to which you subscribe, in which
599 ;; case you may be removed from the list on the grounds that mail to you
600 ;; bounced with a "mailing loop" error).
601 "^Return-receipt\\|^X-Gnus\\|^Gnus-Warning:\\|^>?From \\|^Delivered-To:\
602 \\|^X-Content-Length:\\|^X-UIDL:"
603 "*All headers that match this regexp will be deleted when resending a message."
605 :group 'message-interface
606 :link '(custom-manual "(message)Resending")
607 :type '(repeat :value-to-internal (lambda (widget value)
608 (custom-split-regexp-maybe value))
609 :match (lambda (widget value)
611 (widget-editable-list-match widget value)))
614 (defcustom message-forward-ignored-headers "^Content-Transfer-Encoding:\\|^X-Gnus"
615 "*All headers that match this regexp will be deleted when forwarding a message.
616 This may also be a list of regexps."
618 :group 'message-forwarding
619 :type '(repeat :value-to-internal (lambda (widget value)
620 (custom-split-regexp-maybe value))
621 :match (lambda (widget value)
623 (widget-editable-list-match widget value)))
626 (defcustom message-forward-included-headers nil
627 "If non-nil, delete non-matching headers when forwarding a message.
628 Only headers that match this regexp will be included. This
629 variable should be a regexp or a list of regexps."
631 :group 'message-forwarding
632 :type '(repeat :value-to-internal (lambda (widget value)
633 (custom-split-regexp-maybe value))
634 :match (lambda (widget value)
636 (widget-editable-list-match widget value)))
639 (defcustom message-ignored-cited-headers "."
640 "*Delete these headers from the messages you yank."
641 :group 'message-insertion
642 :link '(custom-manual "(message)Insertion Variables")
645 (defcustom message-cite-prefix-regexp
646 ;; In Emacs 24.1 this defaults to the value of
647 ;; `mail-citation-prefix-regexp'; the default value varies according
648 ;; to the Emacs version. In XEmacs 21.4 and 21.5, sendmail.el
650 (if (string-match "[[:digit:]]" "1")
651 ;; Support POSIX? XEmacs 21.5.27 doesn't.
652 "\\([ \t]*[_.[:word:]]+>+\\|[ \t]*[]>|]\\)+"
653 ;; ?-, ?_ or ?. MUST NOT be in syntax entry w.
654 (let (non-word-constituents)
655 (with-syntax-table text-mode-syntax-table
656 (setq non-word-constituents
658 (if (string-match "\\w" "_") "" "_")
659 (if (string-match "\\w" ".") "" "."))))
660 (if (equal non-word-constituents "")
661 "\\([ \t]*\\(\\w\\)+>+\\|[ \t]*[]>|]\\)+"
662 (concat "\\([ \t]*\\(\\w\\|["
663 non-word-constituents
664 "]\\)+>+\\|[ \t]*[]>|]\\)+"))))
665 "*Regexp matching the longest possible citation prefix on a line."
667 :group 'message-insertion
668 :link '(custom-manual "(message)Insertion Variables")
670 :set (lambda (symbol value)
672 (custom-set-default symbol value)
673 (if (boundp 'gnus-message-cite-prefix-regexp)
674 (setq gnus-message-cite-prefix-regexp
675 (concat "^\\(?:" value "\\)"))))))
677 (defcustom message-cancel-message "I am canceling my own article.\n"
678 "Message to be inserted in the cancel message."
679 :group 'message-interface
680 :link '(custom-manual "(message)Canceling News")
683 (defun message-send-mail-function ()
684 "Return suitable value for the variable `message-send-mail-function'."
685 (cond ((and (require 'sendmail)
686 (boundp 'sendmail-program)
688 (executable-find sendmail-program))
689 'message-send-mail-with-sendmail)
690 ((and (locate-library "smtpmail")
691 (boundp 'smtpmail-default-smtp-server)
692 smtpmail-default-smtp-server)
693 'message-smtpmail-send-it)
694 ((locate-library "mailclient")
695 'message-send-mail-with-mailclient)
697 (error "Don't know how to send mail. Please customize `message-send-mail-function'"))))
699 (defun message-default-send-mail-function ()
700 (cond ((eq send-mail-function 'smtpmail-send-it) 'message-smtpmail-send-it)
701 ((eq send-mail-function 'feedmail-send-it) 'feedmail-send-it)
702 ((eq send-mail-function 'sendmail-query-once) 'sendmail-query-once)
703 ((eq send-mail-function 'mailclient-send-it)
704 'message-send-mail-with-mailclient)
705 (t (message-send-mail-function))))
707 ;; Useful to set in site-init.el
708 (defcustom message-send-mail-function (message-default-send-mail-function)
709 "Function to call to send the current buffer as mail.
710 The headers should be delimited by a line whose contents match the
711 variable `mail-header-separator'.
713 Valid values include `message-send-mail-with-sendmail'
714 `message-send-mail-with-mh', `message-send-mail-with-qmail',
715 `message-smtpmail-send-it', `smtpmail-send-it',
716 `feedmail-send-it' and `message-send-mail-with-mailclient'. The
717 default is system dependent and determined by the function
718 `message-send-mail-function'.
720 See also `send-mail-function'."
721 :type '(radio (function-item message-send-mail-with-sendmail)
722 (function-item message-send-mail-with-mh)
723 (function-item message-send-mail-with-qmail)
724 (function-item message-smtpmail-send-it)
725 (function-item smtpmail-send-it)
726 (function-item feedmail-send-it)
727 (function-item message-send-mail-with-mailclient
728 :tag "Use Mailclient package")
729 (function :tag "Other"))
730 :group 'message-sending
732 :initialize 'custom-initialize-default
733 :link '(custom-manual "(message)Mail Variables")
734 :group 'message-mail)
736 (defcustom message-send-news-function 'message-send-news
737 "Function to call to send the current buffer as news.
738 The headers should be delimited by a line whose contents match the
739 variable `mail-header-separator'."
740 :group 'message-sending
742 :link '(custom-manual "(message)News Variables")
745 (defcustom message-reply-to-function nil
746 "If non-nil, function that should return a list of headers.
747 This function should pick out addresses from the To, Cc, and From headers
748 and respond with new To and Cc headers."
749 :group 'message-interface
750 :link '(custom-manual "(message)Reply")
751 :type '(choice function (const nil)))
753 (defcustom message-wide-reply-to-function nil
754 "If non-nil, function that should return a list of headers.
755 This function should pick out addresses from the To, Cc, and From headers
756 and respond with new To and Cc headers."
757 :group 'message-interface
758 :link '(custom-manual "(message)Wide Reply")
759 :type '(choice function (const nil)))
761 (defcustom message-followup-to-function nil
762 "If non-nil, function that should return a list of headers.
763 This function should pick out addresses from the To, Cc, and From headers
764 and respond with new To and Cc headers."
765 :group 'message-interface
766 :link '(custom-manual "(message)Followup")
767 :type '(choice function (const nil)))
769 (defcustom message-extra-wide-headers nil
770 "If non-nil, a list of additional address headers.
771 These are used when composing a wide reply."
772 :group 'message-sending
773 :type '(repeat string))
775 (defcustom message-use-followup-to 'ask
776 "*Specifies what to do with Followup-To header.
777 If nil, always ignore the header. If it is t, use its value, but
778 query before using the \"poster\" value. If it is the symbol `ask',
779 always query the user whether to use the value. If it is the symbol
780 `use', always use the value."
781 :group 'message-interface
782 :link '(custom-manual "(message)Followup")
783 :type '(choice (const :tag "ignore" nil)
784 (const :tag "use & query" t)
788 (defcustom message-use-mail-followup-to 'use
789 "*Specifies what to do with Mail-Followup-To header.
790 If nil, always ignore the header. If it is the symbol `ask', always
791 query the user whether to use the value. If it is the symbol `use',
792 always use the value."
794 :group 'message-interface
795 :link '(custom-manual "(message)Mailing Lists")
796 :type '(choice (const :tag "ignore" nil)
800 (defcustom message-subscribed-address-functions nil
801 "*Specifies functions for determining list subscription.
802 If nil, do not attempt to determine list subscription with functions.
803 If non-nil, this variable contains a list of functions which return
804 regular expressions to match lists. These functions can be used in
805 conjunction with `message-subscribed-regexps' and
806 `message-subscribed-addresses'."
808 :group 'message-interface
809 :link '(custom-manual "(message)Mailing Lists")
810 :type '(repeat sexp))
812 (defcustom message-subscribed-address-file nil
813 "*A file containing addresses the user is subscribed to.
814 If nil, do not look at any files to determine list subscriptions. If
815 non-nil, each line of this file should be a mailing list address."
817 :group 'message-interface
818 :link '(custom-manual "(message)Mailing Lists")
819 :type '(radio file (const nil)))
821 (defcustom message-subscribed-addresses nil
822 "*Specifies a list of addresses the user is subscribed to.
823 If nil, do not use any predefined list subscriptions. This list of
824 addresses can be used in conjunction with
825 `message-subscribed-address-functions' and `message-subscribed-regexps'."
827 :group 'message-interface
828 :link '(custom-manual "(message)Mailing Lists")
829 :type '(repeat string))
831 (defcustom message-subscribed-regexps nil
832 "*Specifies a list of addresses the user is subscribed to.
833 If nil, do not use any predefined list subscriptions. This list of
834 regular expressions can be used in conjunction with
835 `message-subscribed-address-functions' and `message-subscribed-addresses'."
837 :group 'message-interface
838 :link '(custom-manual "(message)Mailing Lists")
839 :type '(repeat regexp))
841 (defcustom message-allow-no-recipients 'ask
842 "Specifies what to do when there are no recipients other than Gcc/Fcc.
843 If it is the symbol `always', the posting is allowed. If it is the
844 symbol `never', the posting is not allowed. If it is the symbol
845 `ask', you are prompted."
847 :group 'message-interface
848 :link '(custom-manual "(message)Message Headers")
849 :type '(choice (const always)
853 (defcustom message-sendmail-f-is-evil nil
854 "*Non-nil means don't add \"-f username\" to the sendmail command line.
855 Doing so would be even more evil than leaving it out."
856 :group 'message-sending
857 :link '(custom-manual "(message)Mail Variables")
860 (defcustom message-sendmail-envelope-from nil
861 ;; In Emacs 24.1 this defaults to the value of `mail-envelope-from'
862 ;; if it is available, or defaults to nil. sendmail.el provides it;
863 ;; the default value is nil in all (X)Emacsen that Gnus supports.
864 "*Envelope-from when sending mail with sendmail.
865 If this is nil, use `user-mail-address'. If it is the symbol
866 `header', use the From: header of the message."
868 :type '(choice (string :tag "From name")
869 (const :tag "Use From: header from message" header)
870 (const :tag "Use `user-mail-address'" nil))
871 :link '(custom-manual "(message)Mail Variables")
872 :group 'message-sending)
874 (defcustom message-sendmail-extra-arguments nil
875 "Additional arguments to `sendmail-program'."
876 ;; E.g. '("-a" "account") for msmtp
877 :version "23.1" ;; No Gnus
878 :type '(repeat string)
879 ;; :link '(custom-manual "(message)Mail Variables")
880 :group 'message-sending)
882 ;; qmail-related stuff
883 (defcustom message-qmail-inject-program "/var/qmail/bin/qmail-inject"
884 "Location of the qmail-inject program."
885 :group 'message-sending
886 :link '(custom-manual "(message)Mail Variables")
889 (defcustom message-qmail-inject-args nil
890 "Arguments passed to qmail-inject programs.
891 This should be a list of strings, one string for each argument.
892 It may also be a function.
894 For e.g., if you wish to set the envelope sender address so that bounces
895 go to the right place or to deal with listserv's usage of that address, you
896 might set this variable to '(\"-f\" \"you@some.where\")."
897 :group 'message-sending
898 :link '(custom-manual "(message)Mail Variables")
899 :type '(choice (function)
902 (defvar gnus-post-method)
903 (defvar gnus-select-method)
904 (defcustom message-post-method
905 (cond ((and (boundp 'gnus-post-method)
906 (listp gnus-post-method)
909 ((boundp 'gnus-select-method)
912 "*Method used to post news.
913 Note that when posting from inside Gnus, for instance, this
914 variable isn't used."
916 :group 'message-sending
917 ;; This should be the `gnus-select-method' widget, but that might
918 ;; create a dependence to `gnus.el'.
921 (defcustom message-generate-headers-first nil
922 "Which headers should be generated before starting to compose a message.
923 If t, generate all required headers. This can also be a list of headers to
924 generate. The variables `message-required-news-headers' and
925 `message-required-mail-headers' specify which headers to generate.
927 Note that the variable `message-deletable-headers' specifies headers which
928 are to be deleted and then re-generated before sending, so this variable
929 will not have a visible effect for those headers."
930 :group 'message-headers
931 :link '(custom-manual "(message)Message Headers")
932 :type '(choice (const :tag "None" nil)
934 (repeat (sexp :tag "Header"))))
936 (defcustom message-fill-column 72
937 "Column beyond which automatic line-wrapping should happen.
938 Local value for message buffers. If non-nil, also turn on
939 auto-fill in message buffers."
940 :group 'message-various
941 ;; :link '(custom-manual "(message)Message Headers")
942 :type '(choice (const :tag "Don't turn on auto fill" nil)
945 (defcustom message-setup-hook nil
946 "Normal hook, run each time a new outgoing message is initialized.
947 The function `message-setup' runs this hook."
948 :group 'message-various
949 :link '(custom-manual "(message)Various Message Variables")
952 (defcustom message-cancel-hook nil
953 "Hook run when canceling articles."
954 :group 'message-various
955 :link '(custom-manual "(message)Various Message Variables")
958 (defcustom message-signature-setup-hook nil
959 "Normal hook, run each time a new outgoing message is initialized.
960 It is run after the headers have been inserted and before
961 the signature is inserted."
962 :group 'message-various
963 :link '(custom-manual "(message)Various Message Variables")
966 (defcustom message-mode-hook nil
967 "Hook run in message mode buffers."
968 :group 'message-various
971 (defcustom message-header-hook nil
972 "Hook run in a message mode buffer narrowed to the headers."
973 :group 'message-various
976 (defcustom message-header-setup-hook nil
977 "Hook called narrowed to the headers when setting up a message buffer."
978 :group 'message-various
979 :link '(custom-manual "(message)Various Message Variables")
982 (defcustom message-minibuffer-local-map
983 (let ((map (make-sparse-keymap 'message-minibuffer-local-map)))
984 (set-keymap-parent map minibuffer-local-map)
986 "Keymap for `message-read-from-minibuffer'."
987 ;; FIXME improve type.
988 :type '(restricted-sexp :match-alternatives (symbolp keymapp))
990 :group 'message-various)
992 (defcustom message-citation-line-function 'message-insert-citation-line
993 "*Function called to insert the \"Whomever writes:\" line.
995 Predefined functions include `message-insert-citation-line' and
996 `message-insert-formatted-citation-line' (see the variable
997 `message-citation-line-format').
999 Note that Gnus provides a feature where the reader can click on
1000 `writes:' to hide the cited text. If you change this line too much,
1001 people who read your message will have to change their Gnus
1002 configuration. See the variable `gnus-cite-attribution-suffix'."
1004 (function-item :tag "plain" message-insert-citation-line)
1005 (function-item :tag "formatted" message-insert-formatted-citation-line)
1006 (function :tag "Other"))
1007 :link '(custom-manual "(message)Insertion Variables")
1008 :group 'message-insertion)
1010 (defcustom message-citation-line-format "On %a, %b %d %Y, %N wrote:\n"
1011 "Format of the \"Whomever writes:\" line.
1013 The string is formatted using `format-spec'. The following constructs
1016 %f The full From, e.g. \"John Doe <john.doe@example.invalid>\".
1017 %n The mail address, e.g. \"john.doe@example.invalid\".
1018 %N The real name if present, e.g.: \"John Doe\", else fall
1019 back to the mail address.
1020 %F The first name if present, e.g.: \"John\".
1021 %L The last name if present, e.g.: \"Doe\".
1022 %Z, %z The time zone in the numeric form, e.g.:\"+0000\".
1024 All other format specifiers are passed to `format-time-string'
1025 which is called using the date from the article your replying to, but
1026 the date in the formatted string will be expressed in the author's
1027 time zone as much as possible.
1028 Extracting the first (%F) and last name (%L) is done heuristically,
1029 so you should always check it yourself.
1031 Please also read the note in the documentation of
1032 `message-citation-line-function'."
1033 :type '(choice (const :tag "Plain" "%f writes:")
1034 (const :tag "Include date" "On %a, %b %d %Y, %n wrote:")
1036 :link '(custom-manual "(message)Insertion Variables")
1037 :version "23.1" ;; No Gnus
1038 :group 'message-insertion)
1040 (defcustom message-yank-prefix "> "
1041 ;; In Emacs 24.1 this defaults to the value of `mail-yank-prefix'
1042 ;; that defaults to:
1043 ;; `nil' in Emacs 22.1~23.1;
1044 ;; "> " in Emacs 23.2, 24.1, XEmacs 21.4, 21.5, and SXEmacs 22.1
1045 "*Prefix inserted on the lines of yanked messages.
1046 Fix `message-cite-prefix-regexp' if it is set to an abnormal value.
1047 See also `message-yank-cited-prefix' and `message-yank-empty-prefix'."
1050 :link '(custom-manual "(message)Insertion Variables")
1051 :group 'message-insertion)
1053 (defcustom message-yank-cited-prefix ">"
1054 "*Prefix inserted on cited lines of yanked messages.
1055 Fix `message-cite-prefix-regexp' if it is set to an abnormal value.
1056 See also `message-yank-prefix' and `message-yank-empty-prefix'."
1059 :link '(custom-manual "(message)Insertion Variables")
1060 :group 'message-insertion)
1062 (defcustom message-yank-empty-prefix ">"
1063 "*Prefix inserted on empty lines of yanked messages.
1064 See also `message-yank-prefix' and `message-yank-cited-prefix'."
1067 :link '(custom-manual "(message)Insertion Variables")
1068 :group 'message-insertion)
1070 (defcustom message-indentation-spaces 3
1071 ;; In Emacs 24.1 this defaults to the value of
1072 ;; `mail-indentation-spaces' that defaults to `3' in Emacs 22.1~24.1,
1073 ;; and SXEmacs 22.1. In XEmacs 21.4 and 21.5, sendmail.el provides
1074 ;; it; the defalut value is `3'.
1075 "*Number of spaces to insert at the beginning of each cited line.
1076 Used by `message-yank-original' via `message-yank-cite'."
1078 :group 'message-insertion
1079 :link '(custom-manual "(message)Insertion Variables")
1082 (defcustom message-cite-function 'message-cite-original-without-signature
1083 "*Function for citing an original message.
1084 Predefined functions include `message-cite-original' and
1085 `message-cite-original-without-signature'.
1086 Note that these functions use `mail-citation-hook' if that is non-nil."
1087 :type '(radio (function-item message-cite-original)
1088 (function-item message-cite-original-without-signature)
1089 (function-item sc-cite-original)
1090 (function :tag "Other"))
1091 :link '(custom-manual "(message)Insertion Variables")
1092 :version "22.3" ;; Gnus 5.10.12 (changed default)
1093 :group 'message-insertion)
1095 (defcustom message-indent-citation-function 'message-indent-citation
1096 "*Function for modifying a citation just inserted in the mail buffer.
1097 This can also be a list of functions. Each function can find the
1098 citation between (point) and (mark t). And each function should leave
1099 point and mark around the citation text as modified."
1101 :link '(custom-manual "(message)Insertion Variables")
1102 :group 'message-insertion)
1104 (defcustom message-signature t
1105 ;; In Emacs 24.1 this defaults to the value of `mail-signature' that
1107 ;; `nil' in Emacs 22.1~23.1, XEmacs 21.4, 21.5, and SXEmacs 22.1;
1108 ;; `t' in Emacs 23.2, and 24.1
1109 "*String to be inserted at the end of the message buffer.
1110 If t, the `message-signature-file' file will be inserted instead.
1111 If a function, the result from the function will be used instead.
1112 If a form, the result from the form will be used instead."
1115 :link '(custom-manual "(message)Insertion Variables")
1116 :group 'message-insertion)
1118 (defcustom message-signature-file "~/.signature"
1119 ;; In Emacs 24.1 this defaults to the value of `mail-signature-file'
1120 ;; that defaults to "~/.signature" in Emacs 22.1~24.1, and SXEmacs
1121 ;; 22.1. In XEmacs 21.4 and 21.5, sendmail.el provides it;
1122 ;; the defalut value is "~/.signature".
1123 "*Name of file containing the text inserted at end of message buffer.
1124 Ignored if the named file doesn't exist.
1125 If nil, don't insert a signature.
1126 If a path is specified, the value of `message-signature-directory' is ignored,
1129 :type '(choice file (const :tags "None" nil))
1130 :link '(custom-manual "(message)Insertion Variables")
1131 :group 'message-insertion)
1133 (defcustom message-signature-directory nil
1134 "*Name of directory containing signature files.
1135 Comes in handy if you have many such files, handled via posting styles for
1137 If nil, `message-signature-file' is expected to specify the directory if
1139 :type '(choice string (const :tags "None" nil))
1140 :link '(custom-manual "(message)Insertion Variables")
1141 :group 'message-insertion)
1143 (defcustom message-signature-insert-empty-line t
1144 "*If non-nil, insert an empty line before the signature separator."
1147 :link '(custom-manual "(message)Insertion Variables")
1148 :group 'message-insertion)
1150 (defcustom message-cite-reply-position 'traditional
1151 "*Where the reply should be positioned.
1152 If `traditional', reply inline.
1153 If `above', reply above quoted text.
1154 If `below', reply below quoted text.
1156 Note: Many newsgroups frown upon nontraditional reply styles. You
1157 probably want to set this variable only for specific groups,
1158 e.g. using `gnus-posting-styles':
1160 (eval (set (make-local-variable 'message-cite-reply-position) 'above))"
1162 :type '(choice (const :tag "Reply inline" traditional)
1163 (const :tag "Reply above" above)
1164 (const :tag "Reply below" below))
1165 :group 'message-insertion)
1167 (defcustom message-cite-style nil
1168 "*The overall style to be used when yanking cited text.
1169 Value is either `nil' (no variable overrides) or a let-style list
1170 of pairs (VARIABLE VALUE) that will be bound in
1171 `message-yank-original' to do the quoting.
1173 Presets to impersonate popular mail agents are found in the
1174 message-cite-style-* variables. This variable is intended for
1175 use in `gnus-posting-styles', such as:
1177 ((posting-from-work-p) (eval (set (make-local-variable 'message-cite-style) message-cite-style-outlook)))"
1179 :group 'message-insertion
1180 :type '(choice (const :tag "Do not override variables" :value nil)
1181 (const :tag "MS Outlook" :value message-cite-style-outlook)
1182 (const :tag "Mozilla Thunderbird" :value message-cite-style-thunderbird)
1183 (const :tag "Gmail" :value message-cite-style-gmail)
1184 (variable :tag "User-specified")))
1186 (defconst message-cite-style-outlook
1187 '((message-cite-function 'message-cite-original)
1188 (message-citation-line-function 'message-insert-formatted-citation-line)
1189 (message-cite-reply-position 'above)
1190 (message-yank-prefix "")
1191 (message-yank-cited-prefix "")
1192 (message-yank-empty-prefix "")
1193 (message-citation-line-format "\n\n-----------------------\nOn %a, %b %d %Y, %N wrote:\n"))
1194 "Message citation style used by MS Outlook. Use with message-cite-style.")
1196 (defconst message-cite-style-thunderbird
1197 '((message-cite-function 'message-cite-original)
1198 (message-citation-line-function 'message-insert-formatted-citation-line)
1199 (message-cite-reply-position 'above)
1200 (message-yank-prefix "> ")
1201 (message-yank-cited-prefix ">")
1202 (message-yank-empty-prefix ">")
1203 (message-citation-line-format "On %D %R %p, %N wrote:"))
1204 "Message citation style used by Mozilla Thunderbird. Use with message-cite-style.")
1206 (defconst message-cite-style-gmail
1207 '((message-cite-function 'message-cite-original)
1208 (message-citation-line-function 'message-insert-formatted-citation-line)
1209 (message-cite-reply-position 'above)
1210 (message-yank-prefix " ")
1211 (message-yank-cited-prefix " ")
1212 (message-yank-empty-prefix " ")
1213 (message-citation-line-format "On %e %B %Y %R, %f wrote:\n"))
1214 "Message citation style used by Gmail. Use with message-cite-style.")
1216 (defcustom message-distribution-function nil
1217 "*Function called to return a Distribution header."
1218 :group 'message-news
1219 :group 'message-headers
1220 :link '(custom-manual "(message)News Headers")
1221 :type '(choice function (const nil)))
1223 (defcustom message-expires 14
1224 "Number of days before your article expires."
1225 :group 'message-news
1226 :group 'message-headers
1227 :link '(custom-manual "(message)News Headers")
1230 (defcustom message-user-path nil
1231 "If nil, use the NNTP server name in the Path header.
1232 If stringp, use this; if non-nil, use no host name (user name only)."
1233 :group 'message-news
1234 :group 'message-headers
1235 :link '(custom-manual "(message)News Headers")
1236 :type '(choice (const :tag "nntp" nil)
1237 (string :tag "name")
1238 (sexp :tag "none" :format "%t" t)))
1240 ;; This can be the name of a buffer, or a cons cell (FUNCTION . ARGS)
1241 ;; for yanking the original buffer.
1242 (defvar message-reply-buffer nil)
1243 (defvar message-reply-headers nil
1244 "The headers of the current replied article.
1245 It is a vector of the following headers:
1246 \[number subject from date id references chars lines xref extra].")
1247 (defvar message-newsreader nil)
1248 (defvar message-mailer nil)
1249 (defvar message-sent-message-via nil)
1250 (defvar message-checksum nil)
1251 (defvar message-send-actions nil
1252 "A list of actions to be performed upon successful sending of a message.")
1253 (defvar message-return-action nil
1254 "Action to return to the caller after sending or postponing a message.")
1255 (defvar message-exit-actions nil
1256 "A list of actions to be performed upon exiting after sending a message.")
1257 (defvar message-kill-actions nil
1258 "A list of actions to be performed before killing a message buffer.")
1259 (defvar message-postpone-actions nil
1260 "A list of actions to be performed after postponing a message.")
1262 (define-widget 'message-header-lines 'text
1263 "All header lines must be LFD terminated."
1264 :format "%{%t%}:%n%v"
1265 :valid-regexp "^\\'"
1266 :error "All header lines must be newline terminated")
1268 (defcustom message-default-headers ""
1269 "Header lines to be inserted in outgoing messages.
1270 This can be set to a string containing or a function returning
1271 header lines to be inserted before you edit the message, so you
1272 can edit or delete these lines. If set to a function, it is
1273 called and its result is inserted."
1275 :group 'message-headers
1276 :link '(custom-manual "(message)Message Headers")
1278 (message-header-lines :tag "String")
1279 (function :tag "Function")))
1281 (defcustom message-default-mail-headers
1282 ;; Ease the transition from mail-mode to message-mode. See bugs#4431, 5555.
1283 (concat (if (and (boundp 'mail-default-reply-to)
1284 (stringp mail-default-reply-to))
1285 (format "Reply-to: %s\n" mail-default-reply-to))
1286 (if (and (boundp 'mail-self-blind)
1288 (format "BCC: %s\n" user-mail-address))
1289 (if (and (boundp 'mail-archive-file-name)
1290 (stringp mail-archive-file-name))
1291 (format "FCC: %s\n" mail-archive-file-name))
1292 ;; Use the value of `mail-default-headers' if available.
1293 ;; Note: as for XEmacs 21.4 and 21.5, it is unavailable
1294 ;; unless sendmail.el is loaded.
1295 (if (boundp 'mail-default-headers)
1296 mail-default-headers))
1297 "*A string of header lines to be inserted in outgoing mails."
1299 :group 'message-headers
1300 :group 'message-mail
1301 :link '(custom-manual "(message)Mail Headers")
1302 :type 'message-header-lines)
1304 (defcustom message-default-news-headers ""
1305 "*A string of header lines to be inserted in outgoing news articles."
1306 :group 'message-headers
1307 :group 'message-news
1308 :link '(custom-manual "(message)News Headers")
1309 :type 'message-header-lines)
1311 ;; Note: could use /usr/ucb/mail instead of sendmail;
1312 ;; options -t, and -v if not interactive.
1313 (defcustom message-mailer-swallows-blank-line
1314 (if (and (string-match "sparc-sun-sunos\\(\\'\\|[^5]\\)"
1315 system-configuration)
1316 (file-readable-p "/etc/sendmail.cf")
1318 (insert-file-contents "/etc/sendmail.cf")
1319 (goto-char (point-min))
1320 (let ((case-fold-search nil))
1321 (re-search-forward "^OR\\>" nil t))))
1322 ;; According to RFC822, "The field-name must be composed of printable
1323 ;; ASCII characters (i. e., characters that have decimal values between
1324 ;; 33 and 126, except colon)", i. e., any chars except ctl chars,
1326 '(looking-at "[ \t]\\|[][!\"#$%&'()*+,-./0-9;<=>?@A-Z\\\\^_`a-z{|}~]+:"))
1327 "*Set this non-nil if the system's mailer runs the header and body together.
1328 \(This problem exists on Sunos 4 when sendmail is run in remote mode.)
1329 The value should be an expression to test whether the problem will
1331 :group 'message-sending
1332 :link '(custom-manual "(message)Mail Variables")
1336 (define-mail-user-agent 'message-user-agent
1337 'message-mail 'message-send-and-exit
1338 'message-kill-buffer 'message-send-hook)
1340 (defvar message-mh-deletable-headers '(Message-ID Date Lines Sender)
1341 "If non-nil, delete the deletable headers before feeding to mh.")
1343 (defvar message-send-method-alist
1344 '((news message-news-p message-send-via-news)
1345 (mail message-mail-p message-send-via-mail))
1346 "Alist of ways to send outgoing messages.
1347 Each element has the form
1349 \(TYPE PREDICATE FUNCTION)
1351 where TYPE is a symbol that names the method; PREDICATE is a function
1352 called without any parameters to determine whether the message is
1353 a message of type TYPE; and FUNCTION is a function to be called if
1354 PREDICATE returns non-nil. FUNCTION is called with one parameter --
1357 (defcustom message-mail-alias-type 'abbrev
1358 "*What alias expansion type to use in Message buffers.
1359 The default is `abbrev', which uses mailabbrev. `ecomplete' uses
1360 an electric completion mode. nil switches mail aliases off.
1361 This can also be a list of values."
1363 :link '(custom-manual "(message)Mail Aliases")
1364 :type '(choice (const :tag "Use Mailabbrev" abbrev)
1365 (const :tag "Use ecomplete" ecomplete)
1366 (const :tag "No expansion" nil)))
1368 (defcustom message-self-insert-commands '(self-insert-command)
1369 "List of `self-insert-command's used to trigger ecomplete.
1370 When one of those commands is invoked to enter a character in To or Cc
1371 header, ecomplete will suggest the candidates of recipients (see also
1372 `message-mail-alias-type'). If you use some tool to enter non-ASCII
1373 text and it replaces `self-insert-command' with the other command, e.g.
1374 `egg-self-insert-command', you may want to add it to this list."
1375 :group 'message-various
1376 :type '(repeat function))
1378 (defcustom message-auto-save-directory
1379 (if (file-writable-p message-directory)
1380 (file-name-as-directory (expand-file-name "drafts" message-directory))
1382 "*Directory where Message auto-saves buffers if Gnus isn't running.
1383 If nil, Message won't auto-save."
1384 :group 'message-buffers
1385 :link '(custom-manual "(message)Various Message Variables")
1386 :type '(choice directory (const :tag "Don't auto-save" nil)))
1388 (defcustom message-default-charset
1389 (and (not (mm-multibyte-p)) 'iso-8859-1)
1390 "Default charset used in non-MULE Emacsen.
1391 If nil, you might be asked to input the charset."
1394 :link '(custom-manual "(message)Various Message Variables")
1397 (defcustom message-dont-reply-to-names
1398 (and (boundp 'mail-dont-reply-to-names) mail-dont-reply-to-names)
1399 "*Addresses to prune when doing wide replies.
1400 This can be a regexp or a list of regexps. Also, a value of nil means
1401 exclude your own user name only."
1404 :link '(custom-manual "(message)Wide Reply")
1405 :type '(choice (const :tag "Yourself" nil)
1407 (repeat :tag "Regexp List" regexp)))
1409 (defsubst message-dont-reply-to-names ()
1410 (gmm-regexp-concat message-dont-reply-to-names))
1412 (defvar message-shoot-gnksa-feet nil
1413 "*A list of GNKSA feet you are allowed to shoot.
1414 Gnus gives you all the opportunity you could possibly want for
1415 shooting yourself in the foot. Also, Gnus allows you to shoot the
1416 feet of Good Net-Keeping Seal of Approval. The following are foot
1418 `empty-article' Allow you to post an empty article;
1419 `quoted-text-only' Allow you to post quoted text only;
1420 `multiple-copies' Allow you to post multiple copies;