1 ;;; message.el --- composing mail and news messages
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;; Keywords: mail, news
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
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.
33 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
40 ;; Only for the trivial macros mail-header-from, mail-header-date
41 ;; mail-header-references, mail-header-subject, mail-header-id
42 (eval-when-compile (require 'nnheader))
43 ;; This is apparently necessary even though things are autoloaded.
44 ;; Because we dynamically bind mail-abbrev-mode-regexp, we'd better
45 ;; require mailabbrev here.
46 (if (featurep 'xemacs)
47 (require 'mail-abbrevs)
48 (require 'mailabbrev))
53 (autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
55 (defvar gnus-message-group-art)
56 (defvar gnus-list-identifiers) ; gnus-sum is required where necessary
57 (defvar rmail-enable-mime-composing)
59 (defgroup message '((user-mail-address custom-variable)
60 (user-full-name custom-variable))
61 "Mail and news message composing."
62 :link '(custom-manual "(message)Top")
66 (put 'user-mail-address 'custom-type 'string)
67 (put 'user-full-name 'custom-type 'string)
69 (defgroup message-various nil
70 "Various Message Variables."
71 :link '(custom-manual "(message)Various Message Variables")
74 (defgroup message-buffers nil
76 :link '(custom-manual "(message)Message Buffers")
79 (defgroup message-sending nil
81 :link '(custom-manual "(message)Sending Variables")
84 (defgroup message-interface nil
86 :link '(custom-manual "(message)Interface")
89 (defgroup message-forwarding nil
91 :link '(custom-manual "(message)Forwarding")
92 :group 'message-interface)
94 (defgroup message-insertion nil
96 :link '(custom-manual "(message)Insertion")
99 (defgroup message-headers nil
101 :link '(custom-manual "(message)Message Headers")
104 (defgroup message-news nil
105 "Composing News Messages."
108 (defgroup message-mail nil
109 "Composing Mail Messages."
112 (defgroup message-faces nil
113 "Faces used for message composing."
117 (defcustom message-directory "~/Mail/"
118 "*Directory from which all other mail file variables are derived."
119 :group 'message-various
122 (defcustom message-max-buffers 10
123 "*How many buffers to keep before starting to kill them off."
124 :group 'message-buffers
127 (defcustom message-send-rename-function nil
128 "Function called to rename the buffer after sending it."
129 :group 'message-buffers
130 :type '(choice function (const nil)))
132 (defcustom message-fcc-handler-function 'message-output
133 "*A function called to save outgoing articles.
134 This function will be called with the name of the file to store the
135 article in. The default function is `message-output' which saves in Unix
137 :type '(radio (function-item message-output)
138 (function :tag "Other"))
139 :group 'message-sending)
141 (defcustom message-fcc-externalize-attachments nil
142 "If non-nil, attachments are included as external parts in Fcc copies."
145 :group 'message-sending)
147 (defcustom message-courtesy-message
148 "The following message is a courtesy copy of an article\nthat has been posted to %s as well.\n\n"
149 "*This is inserted at the start of a mailed copy of a posted message.
150 If the string contains the format spec \"%s\", the Newsgroups
151 the article has been posted to will be inserted there.
152 If this variable is nil, no such courtesy message will be added."
153 :group 'message-sending
154 :type '(radio string (const nil)))
156 (defcustom message-ignored-bounced-headers
157 "^\\(Received\\|Return-Path\\|Delivered-To\\):"
158 "*Regexp that matches headers to be removed in resent bounced mail."
159 :group 'message-interface
162 (defcustom message-from-style 'default
163 "*Specifies how \"From\" headers look.
165 If nil, they contain just the return address like:
167 If `parens', they look like:
168 king@grassland.com (Elvis Parsley)
169 If `angles', they look like:
170 Elvis Parsley <king@grassland.com>
172 Otherwise, most addresses look like `angles', but they look like
173 `parens' if `angles' would need quoting and `parens' would not."
175 :type '(choice (const :tag "simple" nil)
179 :group 'message-headers)
181 (defcustom message-insert-canlock t
182 "Whether to insert a Cancel-Lock header in news postings."
184 :group 'message-headers
187 (defcustom message-syntax-checks
188 (if message-insert-canlock '((sender . disabled)) nil)
189 ;; Guess this one shouldn't be easy to customize...
190 "*Controls what syntax checks should not be performed on outgoing posts.
191 To disable checking of long signatures, for instance, add
192 `(signature . disabled)' to this list.
194 Don't touch this variable unless you really know what you're doing.
196 Checks include `approved', `bogus-recipient', `continuation-headers',
197 `control-chars', `empty', `existing-newsgroups', `from', `illegible-text',
198 `invisible-text', `long-header-lines', `long-lines', `message-id',
199 `multiple-headers', `new-text', `newsgroups', `quoting-style',
200 `repeated-newsgroups', `reply-to', `sender', `sendsys', `shoot',
201 `shorten-followup-to', `signature', `size', `subject', `subject-cmsg'
202 and `valid-newsgroups'."
204 :type '(repeat sexp)) ; Fixme: improve this
206 (defcustom message-required-headers '((optional . References)
208 "*Headers to be generated or prompted for when sending a message.
209 Also see `message-required-news-headers' and
210 `message-required-mail-headers'."
213 :group 'message-headers
214 :link '(custom-manual "(message)Message Headers")
215 :type '(repeat sexp))
217 (defcustom message-draft-headers '(References From Date)
218 "*Headers to be generated when saving a draft message."
221 :group 'message-headers
222 :link '(custom-manual "(message)Message Headers")
223 :type '(repeat sexp))
225 (defcustom message-required-news-headers
226 '(From Newsgroups Subject Date Message-ID
227 (optional . Organization)
228 (optional . User-Agent))
229 "*Headers to be generated or prompted for when posting an article.
230 RFC977 and RFC1036 require From, Date, Newsgroups, Subject,
231 Message-ID. Organization, Lines, In-Reply-To, Expires, and
232 User-Agent are optional. If you don't want message to insert some
233 header, remove it from this list."
235 :group 'message-headers
236 :link '(custom-manual "(message)Message Headers")
237 :type '(repeat sexp))
239 (defcustom message-required-mail-headers
240 '(From Subject Date (optional . In-Reply-To) Message-ID
241 (optional . User-Agent))
242 "*Headers to be generated or prompted for when mailing a message.
243 It is recommended that From, Date, To, Subject and Message-ID be
244 included. Organization and User-Agent are optional."
246 :group 'message-headers
247 :link '(custom-manual "(message)Message Headers")
248 :type '(repeat sexp))
250 (defcustom message-prune-recipient-rules nil
251 "Rules for how to prune the list of recipients when doing wide replies.
252 This is a list of regexps and regexp matches."
254 :group 'message-headers
255 :link '(custom-manual "(message)Wide Reply")
256 :type '(repeat regexp))
258 (defcustom message-deletable-headers '(Message-ID Date Lines)
259 "Headers to be deleted if they already exist and were generated by message previously."
260 :group 'message-headers
261 :link '(custom-manual "(message)Message Headers")
264 (defcustom message-ignored-news-headers
265 "^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
266 "*Regexp of headers to be removed unconditionally before posting."
268 :group 'message-headers
269 :link '(custom-manual "(message)Message Headers")
270 :type '(repeat :value-to-internal (lambda (widget value)
271 (custom-split-regexp-maybe value))
272 :match (lambda (widget value)
274 (widget-editable-list-match widget value)))
277 (defcustom message-ignored-mail-headers
278 "^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
279 "*Regexp of headers to be removed unconditionally before mailing."
281 :group 'message-headers
282 :link '(custom-manual "(message)Mail Headers")
285 (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:"
286 "*Header lines matching this regexp will be deleted before posting.
287 It's best to delete old Path and Date headers before posting to avoid
289 :group 'message-interface
290 :link '(custom-manual "(message)Superseding")
291 :type '(repeat :value-to-internal (lambda (widget value)
292 (custom-split-regexp-maybe value))
293 :match (lambda (widget value)
295 (widget-editable-list-match widget value)))
298 (defcustom message-subject-re-regexp
299 "^[ \t]*\\([Rr][Ee]\\(\\[[0-9]*\\]\\)*:[ \t]*\\)*[ \t]*"
300 "*Regexp matching \"Re: \" in the subject line."
301 :group 'message-various
302 :link '(custom-manual "(message)Message Headers")
305 ;;; Start of variables adopted from `message-utils.el'.
307 (defcustom message-subject-trailing-was-query 'ask
308 "*What to do with trailing \"(was: <old subject>)\" in subject lines.
309 If nil, leave the subject unchanged. If it is the symbol `ask', query
310 the user what do do. In this case, the subject is matched against
311 `message-subject-trailing-was-ask-regexp'. If
312 `message-subject-trailing-was-query' is t, always strip the trailing
313 old subject. In this case, `message-subject-trailing-was-regexp' is
316 :type '(choice (const :tag "never" nil)
317 (const :tag "always strip" t)
319 :link '(custom-manual "(message)Message Headers")
320 :group 'message-various)
322 (defcustom message-subject-trailing-was-ask-regexp
323 "[ \t]*\\([[(]+[Ww][Aa][Ss][ \t]*.*[\])]+\\)"
324 "*Regexp matching \"(was: <old subject>)\" in the subject line.
326 The function `message-strip-subject-trailing-was' uses this regexp if
327 `message-subject-trailing-was-query' is set to the symbol `ask'. If
328 the variable is t instead of `ask', use
329 `message-subject-trailing-was-regexp' instead.
331 It is okay to create some false positives here, as the user is asked."
333 :group 'message-various
334 :link '(custom-manual "(message)Message Headers")
337 (defcustom message-subject-trailing-was-regexp
338 "[ \t]*\\((*[Ww][Aa][Ss]:[ \t]*.*)\\)"
339 "*Regexp matching \"(was: <old subject>)\" in the subject line.
341 If `message-subject-trailing-was-query' is set to t, the subject is
342 matched against `message-subject-trailing-was-regexp' in
343 `message-strip-subject-trailing-was'. You should use a regexp creating very
344 few false positives here."
346 :group 'message-various
347 :link '(custom-manual "(message)Message Headers")
350 ;;; marking inserted text
352 (defcustom message-mark-insert-begin
353 "--8<---------------cut here---------------start------------->8---\n"
354 "How to mark the beginning of some inserted text."
357 :link '(custom-manual "(message)Insertion Variables")
358 :group 'message-various)
360 (defcustom message-mark-insert-end
361 "--8<---------------cut here---------------end--------------->8---\n"
362 "How to mark the end of some inserted text."
365 :link '(custom-manual "(message)Insertion Variables")
366 :group 'message-various)
368 (defcustom message-archive-header "X-No-Archive: Yes\n"
369 "Header to insert when you don't want your article to be archived.
370 Archives \(such as groups.google.com\) respect this header."
373 :link '(custom-manual "(message)Header Commands")
374 :group 'message-various)
376 (defcustom message-archive-note
377 "X-No-Archive: Yes - save http://groups.google.com/"
378 "Note to insert why you wouldn't want this posting archived.
379 If nil, don't insert any text in the body."
381 :type '(radio string (const nil))
382 :link '(custom-manual "(message)Header Commands")
383 :group 'message-various)
385 ;;; Crossposts and Followups
386 ;; inspired by JoH-followup-to by Jochem Huhman <joh at gmx.de>
387 ;; new suggestions by R. Weikusat <rw at another.de>
389 (defvar message-cross-post-old-target nil
390 "Old target for cross-posts or follow-ups.")
391 (make-variable-buffer-local 'message-cross-post-old-target)
393 (defcustom message-cross-post-default t
394 "When non-nil `message-cross-post-followup-to' will perform a crosspost.
395 If nil, `message-cross-post-followup-to' will only do a followup. Note that
396 you can explicitly override this setting by calling
397 `message-cross-post-followup-to' with a prefix."
400 :group 'message-various)
402 (defcustom message-cross-post-note "Crosspost & Followup-To: "
403 "Note to insert before signature to notify of cross-post and follow-up."
406 :group 'message-various)
408 (defcustom message-followup-to-note "Followup-To: "
409 "Note to insert before signature to notify of follow-up only."
412 :group 'message-various)
414 (defcustom message-cross-post-note-function 'message-cross-post-insert-note
415 "Function to use to insert note about Crosspost or Followup-To.
416 The function will be called with four arguments. The function should not only
417 insert a note, but also ensure old notes are deleted. See the documentation
418 for `message-cross-post-insert-note'."
421 :group 'message-various)
423 ;;; End of variables adopted from `message-utils.el'.
425 (defcustom message-signature-separator "^-- $"
426 "Regexp matching the signature separator.
427 This variable is used to strip off the signature from quoted text
428 when `message-cite-function' is
429 `message-cite-original-without-signature'. Most useful values
430 are \"^-- $\" (strict) and \"^-- *$\" (loose; allow missing
432 :type '(choice (const :tag "strict" "^-- $")
433 (const :tag "loose" "^-- *$")
435 :version "22.3" ;; Gnus 5.10.12 (changed default)
436 :link '(custom-manual "(message)Various Message Variables")
437 :group 'message-various)
439 (defcustom message-elide-ellipsis "\n[...]\n\n"
440 "*The string which is inserted for elided text."
442 :link '(custom-manual "(message)Various Commands")
443 :group 'message-various)
445 (defcustom message-interactive t
446 "Non-nil means when sending a message wait for and display errors.
447 A value of nil means let mailer mail back a message to report errors."
449 :group 'message-sending
451 :link '(custom-manual "(message)Sending Variables")
454 (defcustom message-confirm-send nil
455 "When non-nil, ask for confirmation when sending a message."
456 :group 'message-sending
458 :version "23.1" ;; No Gnus
459 :link '(custom-manual "(message)Sending Variables")
462 (defcustom message-generate-new-buffers 'unique
463 "*Say whether to create a new message buffer to compose a message.
464 Valid values include:
467 Generate the buffer name in the Message way (e.g., *mail*, *news*,
468 *mail to whom*, *news on group*, etc.) and continue editing in the
469 existing buffer of that name. If there is no such buffer, it will
473 Create the new buffer with the name generated in the Message way.
476 Similar to `unique' but the buffer name begins with \"*unsent \".
479 Similar to nil but the buffer name is simpler like *mail message*.
482 If this is a function, call that function with three parameters:
483 The type, the To address and the group name (any of these may be nil).
484 The function should return the new buffer name."
485 :group 'message-buffers
486 :link '(custom-manual "(message)Message Buffers")
487 :type '(choice (const nil)
488 (sexp :tag "unique" :format "unique\n" :value unique
489 :match (lambda (widget value) (memq value '(unique t))))
492 (function :format "\n %{%t%}: %v")))
494 (defcustom message-kill-buffer-on-exit nil
495 "*Non-nil means that the message buffer will be killed after sending a message."
496 :group 'message-buffers
497 :link '(custom-manual "(message)Message Buffers")
500 (defcustom message-kill-buffer-query t
501 "*Non-nil means that killing a modified message buffer has to be confirmed.
502 This is used by `message-kill-buffer'."
503 :version "23.1" ;; No Gnus
504 :group 'message-buffers
507 (defvar gnus-local-organization)
508 (defcustom message-user-organization
509 (or (and (boundp 'gnus-local-organization)
510 (stringp gnus-local-organization)
511 gnus-local-organization)
512 (getenv "ORGANIZATION")
514 "*String to be used as an Organization header.
515 If t, use `message-user-organization-file'."
516 :group 'message-headers
517 :type '(choice string
518 (const :tag "consult file" t)))
520 (defcustom message-user-organization-file
522 (dolist (f (list "/etc/organization"
523 "/etc/news/organization"
524 "/usr/lib/news/organization"))
525 (when (file-readable-p f)
528 "*Local news organization file."
530 :link '(custom-manual "(message)News Headers")
531 :group 'message-headers)
533 (defcustom message-make-forward-subject-function
534 #'message-forward-subject-name-subject
535 "*List of functions called to generate subject headers for forwarded messages.
536 The subject generated by the previous function is passed into each
539 The provided functions are:
541 * `message-forward-subject-author-subject' Source of article (author or
542 newsgroup), in brackets followed by the subject
543 * `message-forward-subject-name-subject' Source of article (name of author
544 or newsgroup), in brackets followed by the subject
545 * `message-forward-subject-fwd' Subject of article with 'Fwd:' prepended
547 :group 'message-forwarding
548 :link '(custom-manual "(message)Forwarding")
549 :type '(radio (function-item message-forward-subject-author-subject)
550 (function-item message-forward-subject-fwd)
551 (function-item message-forward-subject-name-subject)
552 (repeat :tag "List of functions" function)))
554 (defcustom message-forward-as-mime t
555 "*Non-nil means forward messages as an inline/rfc822 MIME section.
556 Otherwise, directly inline the old message in the forwarded message."
558 :group 'message-forwarding
559 :link '(custom-manual "(message)Forwarding")
562 (defcustom message-forward-show-mml 'best
563 "*Non-nil means show forwarded messages as MML (decoded from MIME).
564 Otherwise, forwarded messages are unchanged.
565 Can also be the symbol `best' to indicate that MML should be
566 used, except when it is a bad idea to use MML. One example where
567 it is a bad idea is when forwarding a signed or encrypted
568 message, because converting MIME to MML would invalidate the
571 :group 'message-forwarding
572 :type '(choice (const :tag "use MML" t)
573 (const :tag "don't use MML " nil)
574 (const :tag "use MML when appropriate" best)))
576 (defcustom message-forward-before-signature t
577 "*Non-nil means put forwarded message before signature, else after."
578 :group 'message-forwarding
581 (defcustom message-wash-forwarded-subjects nil
582 "*Non-nil means try to remove as much cruft as possible from the subject.
583 Done before generating the new subject of a forward."
584 :group 'message-forwarding
585 :link '(custom-manual "(message)Forwarding")
588 (defcustom message-ignored-resent-headers
589 ;; `Delivered-To' needs to be removed because some mailers use it to
590 ;; detect loops, so if you resend a message to an address that ultimately
591 ;; comes back to you (e.g. a mailing-list to which you subscribe, in which
592 ;; case you may be removed from the list on the grounds that mail to you
593 ;; bounced with a "mailing loop" error).
594 "^Return-receipt\\|^X-Gnus\\|^Gnus-Warning:\\|^>?From \\|^Delivered-To:"
595 "*All headers that match this regexp will be deleted when resending a message."
596 :group 'message-interface
597 :link '(custom-manual "(message)Resending")
598 :type '(repeat :value-to-internal (lambda (widget value)
599 (custom-split-regexp-maybe value))
600 :match (lambda (widget value)
602 (widget-editable-list-match widget value)))
605 (defcustom message-forward-ignored-headers "^Content-Transfer-Encoding:\\|^X-Gnus"
606 "*All headers that match this regexp will be deleted when forwarding a message."
608 :group 'message-forwarding
609 :type '(repeat :value-to-internal (lambda (widget value)
610 (custom-split-regexp-maybe value))
611 :match (lambda (widget value)
613 (widget-editable-list-match widget value)))
616 (defcustom message-ignored-cited-headers "."
617 "*Delete these headers from the messages you yank."
618 :group 'message-insertion
619 :link '(custom-manual "(message)Insertion Variables")
622 (defcustom message-cite-prefix-regexp
623 (if (string-match "[[:digit:]]" "1")
624 ;; Support POSIX? XEmacs 21.5.27 doesn't.
625 "\\([ \t]*[_.[:word:]]+>+\\|[ \t]*[]>|}]\\)+"
626 ;; ?-, ?_ or ?. MUST NOT be in syntax entry w.
627 (let (non-word-constituents)
628 (with-syntax-table text-mode-syntax-table
629 (setq non-word-constituents
631 (if (string-match "\\w" "_") "" "_")
632 (if (string-match "\\w" ".") "" "."))))
633 (if (equal non-word-constituents "")
634 "\\([ \t]*\\(\\w\\)+>+\\|[ \t]*[]>|}]\\)+"
635 (concat "\\([ \t]*\\(\\w\\|["
636 non-word-constituents
637 "]\\)+>+\\|[ \t]*[]>|}]\\)+"))))
638 "*Regexp matching the longest possible citation prefix on a line."
640 :group 'message-insertion
641 :link '(custom-manual "(message)Insertion Variables")
643 :set (lambda (symbol value)
645 (custom-set-default symbol value)
646 (if (boundp 'gnus-message-cite-prefix-regexp)
647 (setq gnus-message-cite-prefix-regexp
648 (concat "^\\(?:" value "\\)"))))))
650 (defcustom message-cancel-message "I am canceling my own article.\n"
651 "Message to be inserted in the cancel message."
652 :group 'message-interface
653 :link '(custom-manual "(message)Canceling News")
656 (defun message-send-mail-function ()
657 "Return suitable value for the variable `message-send-mail-function'."
658 (cond ((and (require 'sendmail)
659 (boundp 'sendmail-program)
661 (executable-find sendmail-program))
662 'message-send-mail-with-sendmail)
663 ((and (locate-library "smtpmail")
664 (boundp 'smtpmail-default-smtp-server)
665 smtpmail-default-smtp-server)
666 'message-smtpmail-send-it)
667 ((locate-library "mailclient")
668 'message-send-mail-with-mailclient)
670 (error "Don't know how to send mail. Please customize `message-send-mail-function'"))))
672 ;; Useful to set in site-init.el
673 (defcustom message-send-mail-function
674 (cond ((eq send-mail-function 'smtpmail-send-it) 'message-smtpmail-send-it)
675 ((eq send-mail-function 'feedmail-send-it) 'feedmail-send-it)
676 ((eq send-mail-function 'mailclient-send-it)
677 'message-send-mail-with-mailclient)
678 (t (message-send-mail-function)))
679 "Function to call to send the current buffer as mail.
680 The headers should be delimited by a line whose contents match the
681 variable `mail-header-separator'.
683 Valid values include `message-send-mail-with-sendmail'
684 `message-send-mail-with-mh', `message-send-mail-with-qmail',
685 `message-smtpmail-send-it', `smtpmail-send-it',
686 `feedmail-send-it' and `message-send-mail-with-mailclient'. The
687 default is system dependent and determined by the function
688 `message-send-mail-function'.
690 See also `send-mail-function'."
691 :type '(radio (function-item message-send-mail-with-sendmail)
692 (function-item message-send-mail-with-mh)
693 (function-item message-send-mail-with-qmail)
694 (function-item message-smtpmail-send-it)
695 (function-item smtpmail-send-it)
696 (function-item feedmail-send-it)
697 (function-item message-send-mail-with-mailclient
698 :tag "Use Mailclient package")
699 (function :tag "Other"))
700 :group 'message-sending
702 :initialize 'custom-initialize-default
703 :link '(custom-manual "(message)Mail Variables")
704 :group 'message-mail)
706 (defcustom message-send-news-function 'message-send-news
707 "Function to call to send the current buffer as news.
708 The headers should be delimited by a line whose contents match the
709 variable `mail-header-separator'."
710 :group 'message-sending
712 :link '(custom-manual "(message)News Variables")
715 (defcustom message-reply-to-function nil
716 "If non-nil, function that should return a list of headers.
717 This function should pick out addresses from the To, Cc, and From headers
718 and respond with new To and Cc headers."
719 :group 'message-interface
720 :link '(custom-manual "(message)Reply")
721 :type '(choice function (const nil)))
723 (defcustom message-wide-reply-to-function nil
724 "If non-nil, function that should return a list of headers.
725 This function should pick out addresses from the To, Cc, and From headers
726 and respond with new To and Cc headers."
727 :group 'message-interface
728 :link '(custom-manual "(message)Wide Reply")
729 :type '(choice function (const nil)))
731 (defcustom message-followup-to-function nil
732 "If non-nil, function that should return a list of headers.
733 This function should pick out addresses from the To, Cc, and From headers
734 and respond with new To and Cc headers."
735 :group 'message-interface
736 :link '(custom-manual "(message)Followup")
737 :type '(choice function (const nil)))
739 (defcustom message-extra-wide-headers nil
740 "If non-nil, a list of additional address headers.
741 These are used when composing a wide reply."
742 :group 'message-sending
743 :type '(repeat string))
745 (defcustom message-use-followup-to 'ask
746 "*Specifies what to do with Followup-To header.
747 If nil, always ignore the header. If it is t, use its value, but
748 query before using the \"poster\" value. If it is the symbol `ask',
749 always query the user whether to use the value. If it is the symbol
750 `use', always use the value."
751 :group 'message-interface
752 :link '(custom-manual "(message)Followup")
753 :type '(choice (const :tag "ignore" nil)
754 (const :tag "use & query" t)
758 (defcustom message-use-mail-followup-to 'use
759 "*Specifies what to do with Mail-Followup-To header.
760 If nil, always ignore the header. If it is the symbol `ask', always
761 query the user whether to use the value. If it is the symbol `use',
762 always use the value."
764 :group 'message-interface
765 :link '(custom-manual "(message)Mailing Lists")
766 :type '(choice (const :tag "ignore" nil)
770 (defcustom message-subscribed-address-functions nil
771 "*Specifies functions for determining list subscription.
772 If nil, do not attempt to determine list subscription with functions.
773 If non-nil, this variable contains a list of functions which return
774 regular expressions to match lists. These functions can be used in
775 conjunction with `message-subscribed-regexps' and
776 `message-subscribed-addresses'."
778 :group 'message-interface
779 :link '(custom-manual "(message)Mailing Lists")
780 :type '(repeat sexp))
782 (defcustom message-subscribed-address-file nil
783 "*A file containing addresses the user is subscribed to.
784 If nil, do not look at any files to determine list subscriptions. If
785 non-nil, each line of this file should be a mailing list address."
787 :group 'message-interface
788 :link '(custom-manual "(message)Mailing Lists")
789 :type '(radio file (const nil)))
791 (defcustom message-subscribed-addresses nil
792 "*Specifies a list of addresses the user is subscribed to.
793 If nil, do not use any predefined list subscriptions. This list of
794 addresses can be used in conjunction with
795 `message-subscribed-address-functions' and `message-subscribed-regexps'."
797 :group 'message-interface
798 :link '(custom-manual "(message)Mailing Lists")
799 :type '(repeat string))
801 (defcustom message-subscribed-regexps nil
802 "*Specifies a list of addresses the user is subscribed to.
803 If nil, do not use any predefined list subscriptions. This list of
804 regular expressions can be used in conjunction with
805 `message-subscribed-address-functions' and `message-subscribed-addresses'."
807 :group 'message-interface
808 :link '(custom-manual "(message)Mailing Lists")
809 :type '(repeat regexp))
811 (defcustom message-allow-no-recipients 'ask
812 "Specifies what to do when there are no recipients other than Gcc/Fcc.
813 If it is the symbol `always', the posting is allowed. If it is the
814 symbol `never', the posting is not allowed. If it is the symbol
815 `ask', you are prompted."
817 :group 'message-interface
818 :link '(custom-manual "(message)Message Headers")
819 :type '(choice (const always)
823 (defcustom message-sendmail-f-is-evil nil
824 "*Non-nil means don't add \"-f username\" to the sendmail command line.
825 Doing so would be even more evil than leaving it out."