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 (defalias-maybe 'dynamic-link 'ignore)
36 (defalias-maybe 'dynamic-call 'ignore))
38 ;; bind colon keywords for old Emacsen.
41 :symbol-for-testing-whether-colon-keyword-is-available-or-not
43 (let ((kwds '(:cc :date :extra :message-id :number :references :subject)))
45 (set (car kwds) (car kwds))
46 (setq kwds (cdr kwds)))))))
49 "ELMO, Elisp Library for Message Orchestration."
55 (defgroup elmo-setting nil
56 "ELMO common settings."
60 (defcustom elmo-digest-flags '(unread)
61 "Flags which are treated as `digest'."
62 :type '(repeat (symbol :tag "flag"))
65 (defcustom elmo-preserved-flags '(forwarded answered cached new unread)
66 "A list to define preserved flags.
67 Flags in this list can be searched by `any' flag condition.
68 If you want to treat a flag in this list as a `digest' flag,
69 you have to add it to `elmo-digest-flags'.
71 :type '(repeat (symbol :tag "flag"))
76 (defcustom elmo-msgdb-default-type 'standard
77 "*Default type of Message Database for ELMO."
78 :type '(radio (const legacy)
83 (defcustom elmo-msgdb-convert-type 'auto
84 "*MODB conversion type."
85 :type '(radio (const sync)
87 (const :tag "No convert" nil))
91 (defcustom elmo-init-hook '(elmo-global-mark-migrate)
92 "*A hook called when elmo is initialized."
96 (defvar elmo-msgdb-file-header-chop-length 2048
97 "*Number of bytes to get header in one reading from file.")
99 (defcustom elmo-msgdb-directory "~/.elmo"
100 "*ELMO Message Database path."
103 :group 'elmo-setting)
104 (defvar elmo-passwd-alist-file-name "passwd"
105 "*ELMO Password filename.")
106 (defcustom elmo-passwd-life-time nil
107 "*Duration of ELMO Password in seconds. nil means infinity."
108 :type '(choice (const :tag "Infinity" nil)
111 :group 'elmo-setting)
113 (defvar elmo-warning-threshold 30000
114 "*Display warning when the bytes of message exceeds this value.")
116 (defvar elmo-msg-appended-hook nil
117 "A hook called when message is appended to database.")
118 (defvar elmo-msg-deleted-hook nil
119 "A hook called when message is deleted from database.")
120 (defvar elmo-nntp-post-pre-hook nil
121 "A hook called just before the nntp posting.")
124 (defcustom elmo-imap4-set-seen-flag-explicitly
126 "*Set Seen flag explicitly (avoid bug in Google Mail)"
129 :group 'elmo-setting)
131 (defcustom elmo-imap4-default-server "localhost"
132 "*Default IMAP4 server."
135 :group 'elmo-setting)
137 (defcustom elmo-imap4-default-authenticate-type 'login
138 "*Default Authentication type for IMAP4."
139 :type '(radio (const :tag "encoded password transmission (login)" login)
140 (const :tag "CRAM-MD5 authentication (cram-md5)" cram-md5)
141 (const :tag "DIGEST-MD5 authentication (digest-md5)" digest-md5)
142 (const :tag "plain password transmission (clear)" clear)
143 (const :tag "NTLM authentication (ntlm)" ntlm)
144 (function :tag "Other"))
147 (defcustom elmo-imap4-default-user (or (getenv "USER")
150 "*Default username for IMAP4."
153 :group 'elmo-setting)
155 (defcustom elmo-imap4-default-port 143
156 "*Default Port number of IMAP."
159 :group 'elmo-setting)
161 (defcustom elmo-imap4-default-stream-type nil
162 "*Default stream type for IMAP4.
163 Any symbol value of `elmo-network-stream-type-alist' or
164 `elmo-imap4-stream-type-alist'."
168 (defvar elmo-imap4-stream-type-alist nil
169 "*Stream bindings for IMAP4.
170 This is taken precedence over `elmo-network-stream-type-alist'.")
175 (defcustom elmo-nntp-default-server "localhost"
176 "*Default NNTP server."
179 :group 'elmo-setting)
181 (defcustom elmo-nntp-default-user nil
182 "*Default User of NNTP. nil means no user authentication."
183 :type '(choice (const nil)
186 :group 'elmo-setting)
188 (defcustom elmo-nntp-default-port 119
189 "*Default Port number of NNTP."
192 :group 'elmo-setting)
194 (defcustom elmo-nntp-default-stream-type nil
195 "*Default stream type for NNTP.
196 Any symbol value of `elmo-network-stream-type-alist' or
197 `elmo-nntp-stream-type-alist'."
201 (defvar elmo-nntp-stream-type-alist nil
202 "*Stream bindings for NNTP.
203 This is taken precedence over `elmo-network-stream-type-alist'.")
208 (defcustom elmo-pop3-default-user (or (getenv "USER")
211 "*Default username for POP3."
214 :group 'elmo-setting)
216 (defcustom elmo-pop3-default-server "localhost"
217 "*Default POP3 server."
220 :group 'elmo-setting)
222 (defcustom elmo-pop3-default-authenticate-type 'user
223 "*Default Authentication type for POP3."
224 :type '(radio (const :tag "plain password transmission (user)" user)
225 (const :tag "APOP authentication (apop)" apop)
226 (const :tag "CRAM-MD5 authentication (cram-md5)" cram-md5)
227 (const :tag "DIGEST-MD5 authentication (digest-md5)" digest-md5)
228 (const :tag "NTLM authentication (ntlm)" ntlm)
229 (function :tag "Other"))
232 (defcustom elmo-pop3-default-port 110
233 "*Default POP3 port."
236 :group 'elmo-setting)
238 (defcustom elmo-pop3-default-stream-type nil
239 "*Default stream type for POP3.
240 Any symbol value of `elmo-network-stream-type-alist' or
241 `elmo-pop3-stream-type-alist'."
245 (defvar elmo-pop3-stream-type-alist nil
246 "*Stream bindings for POP3.
247 This is taken precedence over `elmo-network-stream-type-alist'.")
249 (defcustom elmo-lang "ja"
250 "Language for displayed messages."
252 :group 'elmo-setting)
254 (defvar elmo-mime-charset 'iso-2022-jp)
256 (defvar elmo-msgdb-mark-filename "mark"
258 (defvar elmo-msgdb-overview-filename "overview"
259 "Overview database.")
260 (defvar elmo-msgdb-number-filename "number"
261 "Message number <=> Message-ID database.")
262 (defvar elmo-msgdb-location-filename "location"
263 "Message number <=> Actual location symbol.")
264 (defvar elmo-msgdb-seen-filename "seen"
265 "Seen message list for append.")
266 (defvar elmo-msgdb-killed-filename "killed"
267 "Deleted messages... contains elmo-killed-msgs-list.")
268 (defvar elmo-msgdb-validity-filename "validity")
269 (defvar elmo-msgdb-flist-filename "flist"
270 "Folder list cache (for access folder).")
271 (defvar elmo-msgdb-finfo-filename "finfo"
272 "Folder information cache...list of '(filename . '(new unread all)).")
273 (defvar elmo-msgdb-lock-list-filename "lock"
274 "Locked messages...list of message-id.
275 For disconnected operations.")
276 (defvar elmo-lost+found-folder "+lost+found"
278 (defvar elmo-crosspost-alist-filename "crosspost-alist"
279 "Alist of crosspost messages.")
281 (defvar elmo-use-server-diff t
282 "Non-nil forces to get unread message information on server.")
284 (defvar elmo-strict-diff-folder-list nil
285 "List of regexps of folder name which should be checked its diff strictly.")
287 (defcustom elmo-msgdb-prefer-in-reply-to-for-parent nil
288 "*Non-nil to prefer In-Reply-To header for finding parent message on thread,
289 rather than References header."
292 :group 'elmo-setting)
294 (defcustom elmo-msgdb-extra-fields nil
295 "Extra fields for msgdb."
296 :type '(repeat string)
298 :group 'elmo-setting)
300 (defcustom elmo-enable-disconnected-operation t
301 "*Non-nil enables disconnected operations."
304 :group 'elmo-setting)
306 (defvar elmo-auto-change-plugged 600
307 "*Time to expire change plugged state automatically, as the number of seconds.
308 Don't change plugged state automatically if nil.")
309 (defvar elmo-plugged-condition 'one
310 "*The condition for `elmo-plugged' becomes on.
311 If `all', when all ports are on. If `one', when even one port is on.
312 If `independent', independent port plugged.
313 If function, return value of function.")
315 (defvar elmo-plug-on-servers nil)
317 (defvar elmo-plug-on-exclude-servers
320 (and (string-match "[^.]+" (system-name))
321 (substring (system-name) 0 (match-end 0)))))
323 (defvar elmo-plugged-alist nil)
325 (defvar elmo-dop-flush-confirm t
326 "*Flush disconnected operations queue with confirmation.")
328 (defvar elmo-path-sep "/"
330 (defvar elmo-plugged t)
332 (defvar elmo-no-subject "(No Subject in original.)"
333 "*A string used when no subject field exists.")
334 (defvar elmo-no-from "nobody@nowhere?"
335 "*A string used when no from field exists.")
337 ;; database dynamic linking
338 (defvar elmo-database-dl-module
339 (expand-file-name "database.so" exec-directory))
341 (defvar elmo-database-dl-handle
342 (if (and (fboundp 'dynamic-link)
344 elmo-database-dl-module))
345 (if (fboundp 'open-database)
347 (dynamic-link elmo-database-dl-module))))
349 (if (and elmo-database-dl-handle
350 (integerp elmo-database-dl-handle))
351 (dynamic-call "emacs_database_init" elmo-database-dl-handle))
353 (defvar elmo-use-database (or (featurep 'dbm)
356 (featurep 'berkeley-db)
357 ;; static/dl-database
358 (fboundp 'open-database)))
360 (defvar elmo-date-match t
361 "Date match is available or not.")
363 (defvar elmo-network-stream-type-alist
364 '(("!" ssl ssl open-ssl-stream)
365 ("!!" starttls starttls starttls-open-stream)
366 ("!socks" socks socks socks-open-network-stream)
367 ("!direct" direct nil open-network-stream))
368 "An alist of (SPEC-STRING SYMBOL FEATURE OPEN-STREAM-FUNCTION).
369 SPEC-STRING is a string for stream-type spec (it must start with '!').
370 SYMBOL is a symbol which indicates the name of the stream type.
371 SYMBOL should be identical in this alist.
372 FEATURE is a symbol of the feature for OPEN-STREAM-FUNCTION.
373 OPEN-STREAM-FUNCTION is a function to open network stream.
374 Arguments for this function are NAME, BUFFER, HOST and SERVICE.")
376 (defvar elmo-folder-info-hashtb nil
377 "Array of folder database information '(max length new unread).")
379 (defvar elmo-crosspost-message-alist nil
380 "List of crosspost message.")
382 (defvar elmo-cache-expire-default-method "size"
383 "Default expiration method.")
385 (defvar elmo-cache-expire-default-size 30000
386 "Cache expiration disk size (Kilo bytes). This must be float value.")
388 (defvar elmo-cache-expire-default-age 50
389 "Cache expiration age (days).")
391 (defvar elmo-cache-directory (expand-file-name "cache" elmo-msgdb-directory)
392 "Directory name for cache storage.")
394 (defvar elmo-pack-number-check-strict t
395 "Pack number strictly.")
397 (defvar elmo-have-link-count
399 ;; OS/2: EMX always returns the link count "1" :-(
400 (or (memq system-type '(OS/2 emx))
401 ;; Meadow seems to have pseudo link count.(suggestion by S.YAMAGUCHI)
402 (and (eq system-type 'windows-nt) (not (featurep 'meadow)))))
403 "Your file system has link count, or not.")
405 (defvar elmo-use-hardlink
406 ;; Any Emacsen may have add-name-to-file(), because loadup.el
407 ;; requires it. :-p Check make-symbolic-link() instead.
408 (fboundp 'make-symbolic-link)
409 "Hardlink is available on your file system, or not.")
411 (defvar elmo-weekday-name-en '["Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat"])
412 (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"])
413 (defvar elmo-weekday-name-fr '["Dim" "Lun" "Mar" "Mer" "Jeu" "Ven" "Sam"])
414 (defvar elmo-weekday-name-de '["Son" "Mon" "Die" "Mit" "Don" "Fre" "Sam"])
416 (defvar elmo-filename-replace-string-alist
427 (defvar elmo-hash-minimum-size 1023
428 "Minimum size of hash table.")
430 (defvar elmo-hash-maximum-size 4095
431 "Maximum size of hash table.")
433 (defvar elmo-use-decoded-cache (featurep 'xemacs)
434 "Use cache of decoded mime charset string.")
436 (defvar elmo-inhibit-number-mapping nil
437 "Global switch to inhibit number mapping (e.g. Inhibit UIDL on POP3).")
439 (defvar elmo-dop-queue nil
440 "Global variable for storing disconnected operation queues.")
442 (defcustom elmo-mime-display-as-is-coding-system (if (boundp 'MULE)
443 '*autoconv* 'undecided)
444 "*Coding system used when message is displayed as is."
448 (defcustom elmo-mailing-list-name-spec-list
450 (x-sequence "^\\([^ ]+\\)")
451 (subject "^\\s(\\(\\S)+\\)[ :][0-9]+\\s)[ \t]*")
452 (list-post "<mailto:\\(.+\\)@")
453 (list-id "<\\([^.]+\\)\\." "^\\([^.]+\\)\\.")
454 (mailing-list ("\\(^\\|; \\)contact \\([^@]+\\)-[^-@]+@" . 2))
455 (return-path "^<\\([^@>]+\\)-return-[0-9]+-")
456 (delivered-to "^mailing list \\([^@]+\\)@"))
457 "*List of spec to extract mailing list name from field value."
459 (choice (symbol :tag "Field Name")
460 (list (symbol :tag "Field Name")
465 (integer :tag "Match Index")))))))
468 (defcustom elmo-mailing-list-count-spec-list
471 (x-sequence "^[^ ]+ \\([^ ]+\\)")
472 (subject "^\\s(\\S)+[ :]\\([0-9]+\\)\\s)[ \t]*")
473 (return-path "^<[^@>]+-return-\\([0-9]+\\)-"))
474 "*List of spec to extract mailing list count from field value."
476 (choice (symbol :tag "Field Name")
477 (list (symbol :tag "Field Name")
482 (integer :tag "Match Index")))))))
486 (product-provide (provide 'elmo-vars) (require 'elmo-version))
488 ;;; elmo-vars.el ends here