1 ;;; elmo-vars.el --- User variables for ELMO.
3 ;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
5 ;; Author: Yuuichi Teranishi <teranisi@gohome.org>
6 ;; Keywords: mail, net news
8 ;; This file is part of ELMO (Elisp Library for Message Orchestration).
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)
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.
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.
33 ;; silence byte compiler
35 (defun-maybe dynamic-link (a))
36 (defun-maybe dynamic-call (a b)))
39 "ELMO, Elisp Library for Message Orchestration."
45 (defgroup elmo-setting nil
46 "ELMO common settings."
52 (defvar elmo-msgdb-file-header-chop-length 2048
53 "*Number of bytes to get header in one reading from file.")
55 (defcustom elmo-msgdb-directory "~/.elmo"
56 "*ELMO Message Database path."
60 (defvar elmo-passwd-alist-file-name "passwd"
61 "*ELMO Password filename.")
62 (defcustom elmo-passwd-life-time nil
63 "*Duration of ELMO Password in seconds. nil means infinity."
64 :type '(choice (const :tag "Infinity" nil)
69 (defvar elmo-warning-threshold 30000
70 "*Display warning when the bytes of message exceeds this value.")
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.")
81 (defcustom elmo-imap4-default-mailbox "inbox"
82 "*Default IMAP4 mailbox."
87 (defcustom elmo-imap4-default-server "localhost"
88 "*Default IMAP4 server."
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"))
103 (defcustom elmo-imap4-default-user (or (getenv "USER")
106 "*Default username for IMAP4."
109 :group 'elmo-setting)
111 (defcustom elmo-imap4-default-port 143
112 "*Default Port number of IMAP."
115 :group 'elmo-setting)
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'."
124 (defvar elmo-imap4-stream-type-alist nil
125 "*Stream bindings for IMAP4.
126 This is taken precedence over `elmo-network-stream-type-alist'.")
131 (defcustom elmo-nntp-default-server "localhost"
132 "*Default NNTP server."
135 :group 'elmo-setting)
137 (defcustom elmo-nntp-default-user nil
138 "*Default User of NNTP. nil means no user authentication."
139 :type '(choice (const nil)
142 :group 'elmo-setting)
144 (defcustom elmo-nntp-default-port 119
145 "*Default Port number of NNTP."
148 :group 'elmo-setting)
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'."
157 (defvar elmo-nntp-stream-type-alist nil
158 "*Stream bindings for NNTP.
159 This is taken precedence over `elmo-network-stream-type-alist'.")
164 (defcustom elmo-pop3-default-user (or (getenv "USER")
167 "*Default username for POP3."
170 :group 'elmo-setting)
172 (defcustom elmo-pop3-default-server "localhost"
173 "*Default POP3 server."
176 :group 'elmo-setting)
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"))
188 (defcustom elmo-pop3-default-port 110
189 "*Default POP3 port."
192 :group 'elmo-setting)
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'."
201 (defvar elmo-pop3-stream-type-alist nil
202 "*Stream bindings for POP3.
203 This is taken precedence over `elmo-network-stream-type-alist'.")
205 (defcustom elmo-lang "ja"
206 "Language for displayed messages."
208 :group 'elmo-setting)
210 (defvar elmo-mime-charset 'iso-2022-jp)
212 (defvar elmo-msgdb-mark-filename "mark"
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"
236 (defvar elmo-crosspost-alist-filename "crosspost-alist"
237 "Alist of crosspost messages.")
239 (defvar elmo-use-server-diff t
240 "Non-nil forces to get unread message information on server.")
242 (defvar elmo-strict-diff-folder-list nil
243 "List of regexps of folder name which should be checked its diff strictly.")
245 (defcustom elmo-msgdb-extra-fields nil
246 "Extra fields for msgdb."
247 :type '(repeat string)
249 :group 'elmo-setting)
251 (defcustom elmo-enable-disconnected-operation t
252 "*Non-nil enables disconnected operations."
255 :group 'elmo-setting)
257 (defvar elmo-auto-change-plugged 600
258 "*Time to expire change plugged state automatically, as the number of seconds.
259 Don't change plugged state automatically if nil.")
260 (defvar elmo-plugged-condition 'one
261 "*The condition for `elmo-plugged' becomes on.
262 If `all', when all ports are on. If `one', when even one port is on.
263 If `independent', independent port plugged.
264 If function, return value of function.")
266 (defvar elmo-plug-on-servers nil)
268 (defvar elmo-plug-on-exclude-servers
271 (and (string-match "[^.]+" (system-name))
272 (substring (system-name) 0 (match-end 0)))))
274 (defvar elmo-plugged-alist nil)
276 (defvar elmo-dop-flush-confirm t
277 "*Flush disconnected operations queue with confirmation.")
279 (defvar elmo-path-sep "/"
281 (defvar elmo-plugged t)
283 (defvar elmo-no-subject "(No Subject in original.)"
284 "*A string used when no subject field exists.")
285 (defvar elmo-no-from "nobody@nowhere?"
286 "*A string used when no from field exists.")
288 ;; database dynamic linking
289 (defvar elmo-database-dl-module
290 (expand-file-name "database.so" exec-directory))
292 (defvar elmo-database-dl-handle
293 (if (and (fboundp 'dynamic-link)
295 elmo-database-dl-module))
296 (if (fboundp 'open-database)
298 (dynamic-link elmo-database-dl-module))))
300 (if (and elmo-database-dl-handle
301 (integerp elmo-database-dl-handle))
302 (dynamic-call "emacs_database_init" elmo-database-dl-handle))
304 (defvar elmo-use-database (or (featurep 'dbm)
307 (featurep 'berkeley-db)
308 ;; static/dl-database
309 (fboundp 'open-database)))
311 (defvar elmo-date-match t
312 "Date match is available or not.")
314 (defvar elmo-network-stream-type-alist
315 '(("!" ssl ssl open-ssl-stream)
316 ("!!" starttls starttls starttls-open-stream)
317 ("!socks" socks socks socks-open-network-stream))
318 "An alist of (SPEC-STRING SYMBOL FEATURE OPEN-STREAM-FUNCTION).
319 SPEC-STRING is a string for stream-type spec (it must start with '!').
320 SYMBOL is a symbol which indicates the name of the stream type.
321 SYMBOL should be identical in this alist.
322 FEATURE is a symbol of the feature for OPEN-STREAM-FUNCTION.
323 OPEN-STREAM-FUNCTION is a function to open network stream.
324 Arguments for this function are NAME, BUFFER, HOST and SERVICE.")
326 (defvar elmo-folder-info-hashtb nil
327 "Array of folder database information '(max length new unread).")
329 (defvar elmo-crosspost-message-alist nil
330 "List of crosspost message.")
332 (defvar elmo-cache-expire-default-method "size"
333 "Default expiration method.")
335 (defvar elmo-cache-expire-default-size 30000
336 "Cache expiration disk size (Kilo bytes). This must be float value.")
338 (defvar elmo-cache-expire-default-age 50
339 "Cache expiration age (days).")
341 (defvar elmo-cache-directory (expand-file-name "cache" elmo-msgdb-directory)
342 "Directory name for cache storage.")
344 (defvar elmo-pack-number-check-strict t
345 "Pack number strictly.")
347 (defvar elmo-have-link-count
349 ;; OS/2: EMX always returns the link count "1" :-(
350 (or (memq system-type '(OS/2 emx))
351 ;; Meadow seems to have pseudo link count.(suggestion by S.YAMAGUCHI)
352 (and (eq system-type 'windows-nt) (not (featurep 'meadow)))))
353 "Your file system has link count, or not.")
355 (defvar elmo-weekday-name-en '["Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat"])
356 (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"])
357 (defvar elmo-weekday-name-fr '["Dim" "Lun" "Mar" "Mer" "Jeu" "Ven" "Sam"])
358 (defvar elmo-weekday-name-de '["Son" "Mon" "Die" "Mit" "Don" "Fre" "Sam"])
360 (defvar elmo-filename-replace-string-alist
371 (defvar elmo-hash-minimum-size 1023
372 "Minimum size of hash table.")
374 (defvar elmo-hash-maximum-size 4095
375 "Maximum size of hash table.")
377 (defvar elmo-use-decoded-cache (featurep 'xemacs)
378 "Use cache of decoded mime charset string.")
380 (defvar elmo-display-progress-threshold 20
381 "*Displaying progress gauge if number of messages are more than this value.")
383 (defvar elmo-inhibit-number-mapping nil
384 "Global switch to inhibit number mapping (e.g. Inhibit UIDL on POP3).")
386 (defvar elmo-display-retrieval-progress-threshold 30000
387 "*Don't display progress if the message size is smaller than this value.")
389 (defvar elmo-inhibit-display-retrieval-progress nil
390 "Global switch to inhibit display progress of each message's retrieval.")
392 (defvar elmo-dop-queue nil
393 "Global variable for storing disconnected operation queues.")
396 (product-provide (provide 'elmo-vars) (require 'elmo-version))
398 ;;; elmo-vars.el ends here