Merge from beta branch.
[elisp/wanderlust.git] / elmo / elmo-vars.el
1 ;;; elmo-vars.el -- User variables for ELMO.
2
3 ;; Copyright 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 (eval-when-compile
34   (defun-maybe dynamic-link (a))
35   (defun-maybe dynamic-call (a b)))
36
37 ;; Version info.
38 (defconst elmo-version "1.1.2")
39 (defconst elmo-appname "ELMO")
40
41 (defun elmo-version ()
42   (format "%s/%s" elmo-appname elmo-version))
43
44 ;; IMAP4
45 (defvar elmo-default-imap4-mailbox "inbox"
46   "*Default IMAP4 mailbox.")
47 (defvar elmo-default-imap4-server "localhost"
48   "*Default IMAP4 server.")
49 (defvar elmo-default-imap4-authenticate-type "auth"
50   "*Default Authentication type for IMAP4.") ; "auth" or "login"
51 (defvar elmo-default-imap4-user (or (getenv "USER") 
52                                     (getenv "LOGNAME") 
53                                     (user-login-name))
54   "*Default username for IMAP4")
55 (defvar elmo-default-imap4-port 143 
56   "*Default Port number of IMAP.")
57 (defvar elmo-default-imap4-ssl nil
58   "*Non-nil forces using SSL by default.")
59
60 ;; POP3
61 (defvar elmo-default-pop3-user (or (getenv "USER") 
62                                    (getenv "LOGNAME") 
63                                    (user-login-name))
64   "*Default username for POP3")
65 (defvar elmo-default-pop3-server  "localhost"
66   "*Default POP3 server.")
67 (defvar elmo-default-pop3-authenticate-type "user"
68   "*Default Authentication type for POP3") ; "apop" or "user"
69 (defvar elmo-default-pop3-port 110
70   "*Default POP3 port.")
71 (defvar elmo-default-pop3-ssl nil
72   "*Non-nil forces using SSL by default.")
73
74 ;; NNTP
75 (defvar elmo-default-nntp-server  "localhost"
76   "*Default NNTP server.")
77 (defvar elmo-default-nntp-user nil
78   "*Default User of NNTP. nil means no user authentication.")
79 (defvar elmo-default-nntp-port 119 
80   "*Default Port number of NNTP")
81 (defvar elmo-default-nntp-ssl nil
82   "*Non-nil forces using SSL by default.")
83
84 (defvar elmo-localdir-folder-path "~/Mail"
85   "*Local mail folder path.")
86 (defvar elmo-localnews-folder-path "~/News"
87   "*Local news folder path.")
88 (defvar elmo-maildir-folder-path "~/Maildir"
89   "*Maildir folder path.")
90 (defvar elmo-maildir-list '("\\+~/Maildir")
91   "*All Folders that match this list will be treated as Maildir.
92 Each elements are regexp of folder name (This is obsolete).")
93 (defvar elmo-msgdb-dir "~/.elmo"
94   "*ELMO Message Database path.")
95 (defvar elmo-passwd-alist-file-name "passwd"
96   "*ELMO Password filename.")
97 (defvar elmo-warning-threshold 30000
98   "*Display warning when the bytes of message exceeds this value.")
99 (defvar elmo-msg-appended-hook nil
100   "A hook called when message is appended to database.")
101 (defvar elmo-msg-deleted-hook nil
102   "A hook called when message is deleted from database")
103 (defvar elmo-nntp-post-pre-hook nil
104   "A hook called just before the nntp posting.")
105 (defvar elmo-lang "ja"
106   "Language for displayed messages.")
107
108 (defvar elmo-mime-charset 'iso-2022-jp)
109 (defvar elmo-search-mime-charset 'iso-2022-jp)
110
111 (defvar elmo-msgdb-mark-filename "mark"
112   "Mark database.")
113 (defvar elmo-msgdb-overview-filename "overview"
114   "Overview database.")
115 (defvar elmo-msgdb-number-filename "number"
116   "Message number <=> Message-ID database.")
117 (defvar elmo-msgdb-location-filename "location"
118   "Message number <=> Actual location symbol.")
119 (defvar elmo-msgdb-seen-filename "seen"
120   "Seen message list for append.")
121 (defvar elmo-msgdb-killed-filename "killed"
122   "Deleted messages... contains elmo-killed-msgs-list.")
123 (defvar elmo-msgdb-validity-filename "validity")
124 (defvar elmo-msgdb-flist-filename "flist"
125   "Folder list cache (for access folder).")
126 (defvar elmo-msgdb-finfo-filename "finfo"
127   "Folder information cache...list of '(filename . '(new unread all)).")
128 (defvar elmo-msgdb-append-list-filename "append"
129   "Appended messages...Structure is same as number-alist. 
130 For disconnected operations.")
131 (defvar elmo-msgdb-resume-list-filename "resume"
132   "Resumed messages. For disconnected operations.")
133 (defvar elmo-msgdb-lock-list-filename "lock"
134   "Locked messages...list of message-id. 
135 For disconnected operations.")
136 (defvar elmo-msgdb-global-mark-filename "global-mark"
137   "Alist of global mark .")
138 (defvar elmo-lost+found-folder "+lost+found"
139   "Lost and found.")
140 (defvar elmo-crosspost-alist-filename "crosspost-alist"
141   "Alist of crosspost messages.")
142
143 (defvar elmo-use-server-diff t
144   "Non-nil forces to get unread message information on server.")
145
146 (defvar elmo-imap4-disuse-server-flag-mailbox-regexp "^#mh" ; UW imapd
147   "If mailbox name matches this value, flags on server are not used except
148  \Delete flag.")
149
150 (defvar elmo-msgdb-extra-fields nil
151   "Extra fields for msgdb.")
152
153 (defvar elmo-queue-filename "queue"
154   "*IMAP pending event queue is saved in this file.")
155 (defvar elmo-enable-disconnected-operation nil
156   "*Enable disconnected operations.")
157
158 (defvar elmo-imap4-overview-fetch-chop-length 200
159   "*Number of overviews to fetch in one request in imap4.")
160 (defvar elmo-nntp-overview-fetch-chop-length 200
161  "*Number of overviews to fetch in one request in nntp.") 
162 (defvar elmo-localdir-header-chop-length 2048
163   "*Number of bytes to get header in one reading from file.")
164 (defvar elmo-imap4-force-login nil
165   "*Non-nil forces to try 'login' if there is no 'auth' capability in imapd.")
166 (defvar elmo-imap4-use-select-to-update-status nil
167   "*Some imapd have to send select command to update status.
168 (ex. UW imapd 4.5-BETA?).  For these imapd, you must set this variable t.")
169
170 (defvar elmo-imap4-use-modified-utf7 nil
171   "*Use mofidied UTF-7 (rfc2060) encoding for IMAP4 folder name.")
172
173 (defvar elmo-auto-change-plugged 600
174   "*Time to expire change plugged state automatically,
175 as the number of seconds. Don't change plugged state automatically if nil.")
176
177 (defvar elmo-plugged-condition 'one
178   "*The condition for `elmo-plugged' becomes on.
179 If `all', when all port is on. If `one', when even one port is on.
180 If `independent', independent port plugged.
181 If function, return value of function.")
182
183 (defvar elmo-plug-on-servers nil)
184
185 (defvar elmo-plug-on-exclude-servers
186   (list "localhost"
187         (system-name)
188         (and (string-match "[^.]+" (system-name))
189              (substring (system-name) 0 (match-end 0)))))
190
191 (defvar elmo-plugged-alist nil)
192
193 (defvar elmo-dop-flush-confirm t
194   "*Flush disconnected operations queue with confirmation.")
195
196 (defvar elmo-path-sep "/"
197   "*Path separator.")
198 (defvar elmo-plugged t)
199 (defvar elmo-use-semi nil)
200 (defvar elmo-no-subject "(No Subject in original.)"
201   "*A string used when no subject field exists.")
202 (defvar elmo-no-from "nobody@nowhere?"
203   "*A string used when no from field exists.")
204
205 (defvar elmo-multi-divide-number 100000
206   "*Multi divider number.")
207
208 ;;; User variables for elmo-archive.
209 (defvar elmo-archive-default-type 'zip
210   "*Default archiver type. The value must be a symbol.")
211
212 ;; database dynamic linking
213 (defvar elmo-database-dl-module
214   (expand-file-name "database.so" exec-directory))
215
216 (defvar elmo-database-dl-handle
217   (if (and (fboundp 'dynamic-link)
218            (file-exists-p
219             elmo-database-dl-module))
220       (if (fboundp 'open-database)
221           t ;;
222         (dynamic-link elmo-database-dl-module))))
223
224 (if (and elmo-database-dl-handle
225          (integerp elmo-database-dl-handle))
226     (dynamic-call "emacs_database_init" elmo-database-dl-handle))
227
228 (defvar elmo-use-database (or (featurep 'dbm)
229                               (featurep 'gnudbm)
230                               (featurep 'berkdb)
231                               (featurep 'berkeley-db)
232                               ;; static/dl-database
233                               (fboundp 'open-database)))
234
235 (defvar elmo-date-match (not (boundp 'nemacs-version))
236   "Date match is available or not")
237
238 (defconst elmo-spec-alist
239   '((?%  . imap4)
240     (?-  . nntp)
241     (?\+ . localdir)
242     (?\* . multi)
243     (?\/ . filter)
244     (?\$ . archive)
245     (?&  . pop3)
246     (?=  . localnews)
247     (?'  . internal)
248     (?|  . pipe)
249     (?.  . maildir)))
250
251 (defvar elmo-debug nil)
252 (defconst mmelmo-entity-buffer-name "*MMELMO-BUFFER*")
253
254 (defvar elmo-folder-info-hashtb nil
255   "Array of folder database information '(max length new unread).")
256
257 (defvar elmo-crosspost-message-alist nil
258   "List of crosspost message.")
259
260 (defvar elmo-cache-expire-default-method "size"
261   "Default expiration method.")
262
263 (defvar elmo-cache-expire-default-size 30000
264   "Cache expiration disk size (Kilo bytes). This must be float value.")
265
266 (defvar elmo-cache-expire-default-age 50
267   "Cache expiration age (days).")
268 (defvar elmo-cache-dirname "cache"
269   "Directory name for cache storage.")
270
271 (defvar elmo-use-buffer-cache t
272   "Use buffer cache.")
273
274 (defvar elmo-buffer-cache-size 10
275   "*Number of buffer for message cache.")
276
277 (defvar elmo-pack-number-check-strict t
278   "Pack number strictly.")
279
280 (defvar elmo-have-link-count
281   (not
282    ;; OS/2: EMX always returns the link count "1" :-(
283    (or (memq system-type '(OS/2 emx))
284        ;; Meadow seems to have pseudo link count.(suggestion by S.YAMAGUCHI)
285        (and (eq system-type 'windows-nt) (not (featurep 'meadow)))))
286   "Your file system has link count, or not.")
287
288 (defvar elmo-weekday-name-en '["Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat"])
289 (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"])
290 (defvar elmo-weekday-name-fr '["Dim" "Lun" "Mar" "Mer" "Jeu" "Ven" "Sam"])
291 (defvar elmo-weekday-name-de '["Son" "Mon" "Die" "Mit" "Don" "Fre" "Sam"])
292
293 (defvar elmo-msgid-replace-string-alist
294   '((":"  . " c")
295     ("*"  . " a")
296     ("?"  . " q")
297     ("<"  . " l")
298     (">"  . " g")
299     ("\"" . " d")
300     ("|"  . " p")
301     ("/"  . " s")
302     ("\\" . " b")))
303
304 (defvar elmo-archive-use-cache nil
305   "Use cache in archive folder.")
306
307 (defvar elmo-nntp-use-cache t
308   "Use cache in nntp folder.")
309
310 (defvar elmo-imap4-use-cache t
311   "Use cache in imap4 folder.")
312
313 (defvar elmo-pop3-use-cache t
314   "Use cache in pop3 folder.")
315
316 (defvar elmo-localdir-lockfile-list nil)
317
318 (defvar elmo-nntp-max-number-precedes-list-active nil
319   "If non-nil, max number of the msgdb is set as the max number of 
320 'list active' (needed for inn 2.3 or later?). ")
321
322 (defvar elmo-pop3-send-command-synchronously nil
323   "If non-nil, commands are send synchronously.
324 If server doesn't accept asynchronous commands, this variable should be 
325 set as non-nil.")
326
327 (provide 'elmo-vars)
328
329 ;;; elmo-vars.el ends here