1 ;;; mail-source.el --- functions for fetching mail
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;; Keywords: news, mail
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, or (at your option)
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; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 ;; Boston, MA 02110-1301, USA.
32 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
34 (require 'format-spec)
39 (autoload 'pop3-movemail "pop3")
40 (autoload 'pop3-get-message-count "pop3")
41 (autoload 'nnheader-cancel-timer "nnheader"))
43 (require 'message) ;; for `message-directory'
45 (defvar display-time-mail-function)
48 (defgroup mail-source nil
49 "The mail-fetching library."
53 ;; Define these at compile time to avoid dragging in imap always.
54 (defconst mail-source-imap-authenticators
57 (list 'const (car a)))
58 imap-authenticator-alist)))
59 (defconst mail-source-imap-streams
62 (list 'const (car a)))
65 (defcustom mail-sources '((file))
66 "Where the mail backends will look for incoming mail.
67 This variable is a list of mail source specifiers.
68 See Info node `(gnus)Mail Source Specifiers'."
70 :version "23.0" ;; No Gnus
71 :link '(custom-manual "(gnus)Mail Source Specifiers")
73 (const :tag "None" nil)
75 (choice :format "%[Value Menu%] %v"
77 (cons :tag "Group parameter `mail-source'"
78 (const :format "" group))
79 (cons :tag "Spool file"
80 (const :format "" file)
81 (checklist :tag "Options" :greedy t
83 (const :format "" :value :path)
85 (cons :tag "Several files in a directory"
86 (const :format "" directory)
87 (checklist :tag "Options" :greedy t
89 (const :format "" :value :path)
90 (directory :tag "Path"))
92 (const :format "" :value :suffix)
93 (string :tag "Suffix"))
95 (const :format "" :value :predicate)
96 (function :tag "Predicate"))
98 (const :format "" :value :prescript)
99 (choice :tag "Prescript"
101 (string :format "%v")
102 (function :format "%v")))