* elmo-vars.el (elmo-imap4-default-authenticate-type): Give
[elisp/wanderlust.git] / elmo / elmo-vars.el
1 ;;; elmo-vars.el --- User variables for ELMO.
2
3 ;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
4
5 ;; Author: Yuuichi Teranishi <teranisi@gohome.org>
6 ;; Keywords: mail, net news
7
8 ;; This file is part of ELMO (Elisp Library for Message Orchestration).
9
10 ;; This program 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 2, or (at your option)
13 ;; any later version.
14 ;;
15 ;; This program 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.
19 ;;
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24 ;;
25
26 ;;; Commentary:
27 ;;
28
29 ;;; Code:
30 ;;
31 (require 'poe)
32
33 ;; silence byte compiler
34 (eval-when-compile
35   (defun-maybe dynamic-link (a))
36   (defun-maybe dynamic-call (a b)))
37
38 (defgroup elmo nil
39   "ELMO, Elisp Library for Message Orchestration."
40   :tag "ELMO"
41   :prefix "elmo-"
42   :group 'news
43   :group 'mail)
44
45 (defgroup elmo-setting nil
46   "ELMO common settings."
47   :prefix "elmo-"
48   :group 'elmo)
49
50 ;; Local
51 (defvar elmo-localnews-folder-path "~/News"
52   "*Local news folder path.")
53 (defvar elmo-maildir-folder-path "~/Maildir"
54   "*Maildir folder path.")
55 (defvar elmo-maildir-list '("\\+~/Maildir")
56   "*All Folders that match this list will be treated as Maildir.
57 Each elements are regexp of folder name (This is obsolete).")
58
59 (defvar elmo-msgdb-file-header-chop-length 2048
60   "*Number of bytes to get header in one reading from file.")
61
62 (defvar elmo-msgdb-directory "~/.elmo"
63   "*ELMO Message Database path.")
64 (defvar elmo-passwd-alist-file-name "passwd"
65   "*ELMO Password filename.")
66 (defvar elmo-passwd-life-time nil
67   "*Duration of ELMO Password in seconds.  nil means infinity.")
68
69 (defvar elmo-warning-threshold 30000
70   "*Display warning when the bytes of message exceeds this value.")
71
72 (defvar elmo-msg-appended-hook nil
73   "A hook called when message is appended to database.")
74 (defvar elmo-msg-deleted-hook nil
75   "A hook called when message is deleted from database.")
76 (defvar elmo-nntp-post-pre-hook nil
77   "A hook called just before the nntp posting.")
78
79 ;;; IMAP4
80
81 (defcustom elmo-imap4-default-mailbox "inbox"
82   "*Default IMAP4 mailbox."
83   :type 'string
84   :group 'elmo
85   :group 'elmo-setting)
86
87 (defcustom elmo-imap4-default-server "localhost"
88   "*Default IMAP4 server."
89   :type 'string
90   :group 'elmo
91   :group 'elmo-setting)
92
93 (defcustom elmo-imap4-default-authenticate-type 'login
94   "*Default Authentication type for IMAP4."
95   :type '(radio (const :tag "encoded password transmission (login)" login)
96                 (const :tag "CRAM-MD5 authentication (cram-md5)" cram-md5)
97                 (const :tag "DIGEST-MD5 authentication (digest-md5)" digest-md5)
98                 (const :tag "plain password transmission (clear)" clear)
99                 (const :tag "NTLM authentication (ntlm)" ntlm)
100                 (function :tag "Other"))
101   :group 'elmo)
102
103 (defcustom elmo-imap4-default-user (or (getenv "USER")
104                                        (getenv "LOGNAME")
105                                        (user-login-name))
106   "*Default username for IMAP4."
107   :type 'string
108   :group 'elmo
109   :group 'elmo-setting)
110
111 (defcustom elmo-imap4-default-port 143
112   "*Default Port number of IMAP."
113   :type 'integer
114   :group 'elmo
115   :group 'elmo-setting)
116
117 (defcustom elmo-imap4-default-stream-type nil
118   "*Default stream type for IMAP4.
119 Any symbol value of `elmo-network-stream-type-alist' or
120 `elmo-imap4-stream-type-alist'."
121   :type 'symbol
122   :group 'elmo)
123
124 (defvar elmo-imap4-stream-type-alist nil
125   "*Stream bindings for IMAP4.
126 This is taken precedence over `elmo-network-stream-type-alist'.")
127
128 ;;; NNTP
129
130 ;; User options
131 (defcustom elmo-nntp-default-server "localhost"
132   "*Default NNTP server."
133   :type 'string
134   :group 'elmo
135   :group 'elmo-setting)
136
137 (defcustom elmo-nntp-default-user nil
138   "*Default User of NNTP.  nil means no user authentication."
139   :type '(choice (const nil)
140                  string)
141   :group 'elmo
142   :group 'elmo-setting)
143
144 (defcustom elmo-nntp-default-port 119
145   "*Default Port number of NNTP."
146   :type 'integer
147   :group 'elmo
148   :group 'elmo-setting)
149
150 (defcustom elmo-nntp-default-stream-type nil
151   "*Default stream type for NNTP.
152 Any symbol value of `elmo-network-stream-type-alist' or
153 `elmo-nntp-stream-type-alist'."
154   :type 'symbol
155   :group 'elmo)
156
157 (defvar elmo-nntp-stream-type-alist nil
158   "*Stream bindings for NNTP.
159 This is taken precedence over `elmo-network-stream-type-alist'.")
160
161 ;;; POP3
162
163 ;; POP3
164 (defcustom elmo-pop3-default-user (or (getenv "USER")
165                                       (getenv "LOGNAME")
166                                       (user-login-name))
167   "*Default username for POP3."
168   :type 'string
169   :group 'elmo
170   :group 'elmo-setting)
171
172 (defcustom elmo-pop3-default-server  "localhost"
173   "*Default POP3 server."
174   :type 'string
175   :group 'elmo
176   :group 'elmo-setting)
177
178 (defcustom elmo-pop3-default-authenticate-type 'user
179   "*Default Authentication type for POP3."
180   :type '(radio (const :tag "plain password transmission (user)" user)
181                 (const :tag "APOP authentication (apop)" apop)
182                 (const :tag "CRAM-MD5 authentication (cram-md5)" cram-md5)
183                 (const :tag "DIGEST-MD5 authentication (digest-md5)" digest-md5)
184                 (const :tag "NTLM authentication (ntlm)" ntlm)
185                 (function :tag "Other"))
186   :group 'elmo)
187
188 (defcustom elmo-pop3-default-port 110
189   "*Default POP3 port."
190   :type 'integer
191   :group 'elmo
192   :group 'elmo-setting)
193
194 (defcustom elmo-pop3-default-stream-type nil
195   "*Default stream type for POP3.
196 Any symbol value of `elmo-network-stream-type-alist' or
197 `elmo-pop3-stream-type-alist'."
198   :type 'symbol
199   :group 'elmo)
200
201 (defvar elmo-pop3-stream-type-alist nil
202   "*Stream bindings for POP3.
203 This is taken precedence over `elmo-network-stream-type-alist'.")
204
205 (defcustom elmo-lang "ja"
206   "Language for displayed messages."
207   :type 'string
208   :group 'elmo-setting)
209
210 (defvar elmo-mime-charset 'iso-2022-jp)
211
212 (defvar elmo-msgdb-mark-filename "mark"
213   "Mark database.")
214 (defvar elmo-msgdb-overview-filename "overview"
215   "Overview database.")
216 (defvar elmo-msgdb-number-filename "number"
217   "Message number <=> Message-ID database.")
218 (defvar elmo-msgdb-location-filename "location"
219   "Message number <=> Actual location symbol.")
220 (defvar elmo-msgdb-seen-filename "seen"
221   "Seen message list for append.")
222 (defvar elmo-msgdb-killed-filename "killed"
223   "Deleted messages... contains elmo-killed-msgs-list.")
224 (defvar elmo-msgdb-validity-filename "validity")
225 (defvar elmo-msgdb-flist-filename "flist"
226   "Folder list cache (for access folder).")
227 (defvar elmo-msgdb-finfo-filename "finfo"
228   "Folder information cache...list of '(filename . '(new unread all)).")
229 (defvar elmo-msgdb-lock-list-filename "lock"
230   "Locked messages...list of message-id.
231 For disconnected operations.")
232 (defvar elmo-msgdb-global-mark-filename "global-mark"
233   "Alist of global mark.")
234 (defvar elmo-lost+found-folder "+lost+found"
235   "Lost and found.")
236 (defvar elmo-crosspost-alist-filename "crosspost-alist"
237   "Alist of crosspost messages.")
238
239 (defvar elmo-use-server-diff t
240   "Non-nil forces to get unread message information on server.")
241
242 (defvar elmo-strict-diff-folder-list nil
243   "List of regexps of folder name which should be checked its diff strictly.")
244
245 (defvar elmo-msgdb-extra-fields nil
246   "Extra fields for msgdb.")
247
248 (defvar elmo-enable-disconnected-operation t
249   "*Enable disconnected operations.")
250
251 (defvar elmo-auto-change-plugged 600
252   "*Time to expire change plugged state automatically, as the number of seconds.
253 Don't change plugged state automatically if nil.")
254 (defvar elmo-plugged-condition 'one
255   "*The condition for `elmo-plugged' becomes on.
256 If `all', when all ports are on.  If `one', when even one port is on.
257 If `independent', independent port plugged.
258 If function, return value of function.")
259
260 (defvar elmo-plug-on-servers nil)
261
262 (defvar elmo-plug-on-exclude-servers
263   (list "localhost"
264         (system-name)
265         (and (string-match "[^.]+" (system-name))
266              (substring (system-name) 0 (match-end 0)))))
267
268 (defvar elmo-plugged-alist nil)
269
270 (defvar elmo-dop-flush-confirm t
271   "*Flush disconnected operations queue with confirmation.")
272
273 (defvar elmo-path-sep "/"
274   "*Path separator.")
275 (defvar elmo-plugged t)
276
277 (defvar elmo-no-subject "(No Subject in original.)"
278   "*A string used when no subject field exists.")
279 (defvar elmo-no-from "nobody@nowhere?"
280   "*A string used when no from field exists.")
281
282 ;; database dynamic linking
283 (defvar elmo-database-dl-module
284   (expand-file-name "database.so" exec-directory))
285
286 (defvar elmo-database-dl-handle
287   (if (and (fboundp 'dynamic-link)
288            (file-exists-p
289             elmo-database-dl-module))
290       (if (fboundp 'open-database)
291           t ;;
292         (dynamic-link elmo-database-dl-module))))
293
294 (if (and elmo-database-dl-handle
295          (integerp elmo-database-dl-handle))
296     (dynamic-call "emacs_database_init" elmo-database-dl-handle))
297
298 (defvar elmo-use-database (or (featurep 'dbm)
299                               (featurep 'gnudbm)
300                               (featurep 'berkdb)
301                               (featurep 'berkeley-db)
302                               ;; static/dl-database
303                               (fboundp 'open-database)))
304
305 (defvar elmo-date-match t
306   "Date match is available or not.")
307
308 (defvar elmo-network-stream-type-alist
309   '(("!"      ssl       ssl      open-ssl-stream)
310     ("!!"     starttls  starttls starttls-open-stream)
311     ("!socks" socks     socks    socks-open-network-stream))
312   "An alist of (SPEC-STRING SYMBOL FEATURE OPEN-STREAM-FUNCTION).
313 SPEC-STRING is a string for stream-type spec (it must start with '!').
314 SYMBOL is a symbol which indicates the name of the stream type.
315 SYMBOL should be identical in this alist.
316 FEATURE is a symbol of the feature for OPEN-STREAM-FUNCTION.
317 OPEN-STREAM-FUNCTION is a function to open network stream.
318 Arguments for this function are NAME, BUFFER, HOST and SERVICE.")
319
320 (defvar elmo-folder-info-hashtb nil
321   "Array of folder database information '(max length new unread).")
322
323 (defvar elmo-crosspost-message-alist nil
324   "List of crosspost message.")
325
326 (defvar elmo-cache-expire-default-method "size"
327   "Default expiration method.")
328
329 (defvar elmo-cache-expire-default-size 30000
330   "Cache expiration disk size (Kilo bytes).  This must be float value.")
331
332 (defvar elmo-cache-expire-default-age 50
333   "Cache expiration age (days).")
334
335 (defvar elmo-cache-directory (expand-file-name "cache" elmo-msgdb-directory)
336   "Directory name for cache storage.")
337
338 (defvar elmo-pack-number-check-strict t
339   "Pack number strictly.")
340
341 (defvar elmo-have-link-count
342   (not
343    ;; OS/2: EMX always returns the link count "1" :-(
344    (or (memq system-type '(OS/2 emx))
345        ;; Meadow seems to have pseudo link count.(suggestion by S.YAMAGUCHI)
346        (and (eq system-type 'windows-nt) (not (featurep 'meadow)))))
347   "Your file system has link count, or not.")
348
349 (defvar elmo-weekday-name-en '["Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat"])
350 (defvar elmo-weekday-name-ja '["\e$BF|\e(B" "\e$B7n\e(B" "\e$B2P\e(B" "\e$B?e\e(B" "\e$BLZ\e(B" "\e$B6b\e(B" "\e$BEZ\e(B"])
351 (defvar elmo-weekday-name-fr '["Dim" "Lun" "Mar" "Mer" "Jeu" "Ven" "Sam"])
352 (defvar elmo-weekday-name-de '["Son" "Mon" "Die" "Mit" "Don" "Fre" "Sam"])
353
354 (defvar elmo-filename-replace-string-alist
355   '((":"  . " c")
356     ("*"  . " a")
357     ("?"  . " q")
358     ("<"  . " l")
359     (">"  . " g")
360     ("\"" . " d")
361     ("|"  . " p")
362     ("/"  . " s")
363     ("\\" . " b")))
364
365 (defvar elmo-hash-minimum-size 1023
366   "Minimum size of hash table.")
367
368 (defvar elmo-hash-maximum-size 4095
369   "Maximum size of hash table.")
370
371 (defvar elmo-use-decoded-cache (featurep 'xemacs)
372   "Use cache of decoded mime charset string.")
373
374 (defvar elmo-use-overview-hashtb t
375   "Use hash table of overview.")
376
377 (defvar elmo-display-progress-threshold 20
378   "*Displaying progress gauge if number of messages are more than this value.")
379
380 (defvar elmo-inhibit-number-mapping nil
381   "Global switch to inhibit number mapping (e.g. Inhibit UIDL on POP3).")
382
383 (defvar elmo-display-retrieval-progress-threshold 30000
384   "*Don't display progress if the message size is smaller than this value.")
385
386 (defvar elmo-inhibit-display-retrieval-progress nil
387   "Global switch to inhibit display progress of each message's retrieval.")
388
389 (defvar elmo-dop-queue nil
390   "Global variable for storing disconnected operation queues.")
391
392 (require 'product)
393 (product-provide (provide 'elmo-vars) (require 'elmo-version))
394
395 ;;; elmo-vars.el ends here