;;; cmail-use-simap4.el --- use simap4 to access email

;; Author: Takeshi Morishima (tm@onepost.net)
;; Keywords: mail
;; Created at: Sat Feb 26 15:39:56 JST 2000

;; This file is part of cmail (a mail utility for GNU Emacs)

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or (at
;; your option) any later version.

;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;; General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING.  If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.

;;; Commentary:

;; This is a cmail option feature module for simap4.el.

;;; Code:

(require 'path-util)
(require 'cmail-vars)
(require 'cmail-modes)
(require 'cmail-folders)

;;; Customize variables
(cmail-i18n-defgroup cmail-simap4-group nil
  ((ja_JP . "simap4.elを利用してIMAP4サーバにアクセスするための設定。")
   (en_US . "Customization for accessing mail servers using simap4.el."))
  :group 'cmail-other-features)

(defun cmail-set-simap4 (var flag)
  (set var flag)
  (if flag (cmail-use-simap4-setup)
    (cmail-use-simap4-unsetup)))

(defun cmail-use-simap4-setup ()

  (setq cmail-content-supply-function 'cmail-simap4-supply-body)
  (autoload 'cmail-simap4-supply-body "cmail-simap4")

  (setq cmail-message-copy-function 'cmail-simap4-copy-message)
  (autoload 'cmail-simap4-copy-body "cmail-simap4")

  (setq cmail-message-delete-function 'cmail-simap4-delete-message)
  (autoload 'cmail-simap4-delete-message "cmail-simap4")

  (setq cmail-message-mark-function 'cmail-simap4-mark-message)
  (autoload 'cmail-simap4-mark-message "cmail-simap4")

  (setq cmail-message-status-function 'cmail-simap4-message-status)
  (autoload 'cmail-simap4-message-status "cmail-simap4")

  (setq cmail-message-expunge-function 'cmail-simap4-expunge-messages)
  (autoload 'cmail-simap4-expunge-messages "cmail-simap4")

  (setq cmail-mailbox-open-function 'cmail-simap4-open-mailbox)
  (autoload 'cmail-simap4-open-mailbox "cmail-simap4")

  (setq cmail-mailbox-delete-function 'cmail-simap4-delete-mailbox)
  (autoload 'cmail-simap4-delete-mailbox "cmail-simap4")

  (setq cmail-mailbox-rename-function 'cmail-simap4-rename-mailbox)
  (autoload 'cmail-simap4-rename-mailbox "cmail-simap4")

  (setq cmail-mailbox-copy-function 'cmail-simap4-copy-mailbox)
  (autoload 'cmail-simap4-copy-mailbox "cmail-simap4")

  (setq cmail-mailbox-search-function 'cmail-simap4-search-mailbox)
  (autoload 'cmail-simap4-search-mailbox "cmail-simap4")

  (setq cmail-folders-update-function 'cmail-simap4-sync-folders)
  (autoload 'cmail-simap4-sync-folders "cmail-simap4")

  (setq cmail-folders-search-function 'cmail-simap4-search-folders)
  (autoload 'cmail-simap4-search-folders "cmail-simap4")

  (setq cmail-summary-message-fetch-function 'cmail-simap4-get-new-messages)
  (autoload 'cmail-simap4-sync-folders "cmail-simap4")

  (setq cmail-virtual-folder-check-function 'cmail-simap4-firtual-folder-p)
  (autoload 'cmail-simap4-sync-folders "cmail-simap4")

  (add-hook 'cmail-open-folder-hook 'cmail-simap4-open-folder-hook)
  (autoload 'cmail-simap4-open-folder-hook "cmail-simap4")

  (add-hook 'cmail-quit-hook 'cmail-simap4-quit)
  (autoload 'cmail-simap4-quit "cmail-simap4")

  (define-key cmail-summary-mode-map "\C-c " 'cmail-simap4-force-read-content)
  (autoload 'cmail-simap4-force-read-content "cmail-simap4" "" t)
  (define-key cmail-summary-mode-map "G" 'cmail-simap4-sync-folder)
  (autoload 'cmail-simap4-sync-folder "cmail-simap4" "" t)
  (define-key cmail-folders-mode-map "G" 'cmail-simap4-sync-all-folders)
  (autoload 'cmail-simap4-sync-all-folder "cmail-simap4" "" t)
  (define-key cmail-summary-mode-map "\M-s" 'cmail-simap4-search)
  (define-key cmail-folders-mode-map "\M-s" 'cmail-simap4-search)
  (autoload 'cmail-simap4-search "cmail-simap4" "" t))

(defun cmail-use-simap4-unsetup ()
  (setq cmail-content-supply-function nil)
  (setq cmail-message-copy-function nil)
  (setq cmail-message-delete-function nil)
  (setq cmail-message-mark-function nil)
  (setq cmail-message-status-function nil)
  (setq cmail-message-expunge-function nil)
  (setq cmail-mailbox-open-function nil)
  (setq cmail-mailbox-delete-function nil)
  (setq cmail-mailbox-rename-function nil)
  (setq cmail-mailbox-copy-function nil)
  (setq cmail-mailbox-search-function nil)
  (setq cmail-folders-update-function nil)
  (setq cmail-folders-search-function nil)
  (setq cmail-summary-message-fetch-function nil)
  (setq cmail-virtual-folder-check-function nil)
  (remove-hook 'cmail-open-folder-hook 'cmail-simap4-open-folder-hook)
  (remove-hook 'cmail-quit-hook 'cmail-simap4-quit)
  (define-key cmail-summary-mode-map "\C-c " nil)
  (define-key cmail-summary-mode-map "\M-s" nil)
  (define-key cmail-folders-mode-map "\M-s" nil)
  (if (featurep 'cmail-simap4) (unload-feature 'cmail-simap4)))

(cmail-i18n-defcustom cmail-use-simap4 nil
  ((ja_JP . "\
*Non nil ならば simap4.el を利用して IMAP4 サーバにアクセスする。")
   (en_US . "\
*Non nil means use simap4.el to access IMAP4 servers."))
  :type 'boolean
  :set 'cmail-set-simap4
  :group 'cmail-all-variables
  :group 'cmail-simap4-group)
(cmail-custom-add-init 'cmail-set-simap4 'cmail-use-simap4)

(cmail-i18n-defcustom cmail-simap4-servers nil
  ((ja_JP . "\
*Simple IMAP4 用のサーバ設定。

各フィールドは次の意味になります。

Record Format: レコードのフォーマットバージョン。変更できません。
Record State: このサーバに接続したくない場合 inactive にします。
Server: IMAP4 サーバ名。
UserID: IMAP4 サーバにログインする時のユーザ識別文字列。
TopDir: ローカルホスト上のディレクトリ。cmail-path から相対パス。
        設定されていなければユーザID@サーバ名がディレクトリとな
        ります。
Virtual Folder: ローカルホスト上で仮想フォルダを使用するか。仮
        想フォルダだと、cmail 終了時ダウンロード情報は消えてし
        まいます。
Mailboxes to Hide: フォルダ同期で無視する mailbox 名の文字列の
        リスト。 \"regexp: \" で始まる場合正規表現とみなされます。
DraftMbox: ドラフトを保存する mailbox 名の文字列。(まだサポート
        してません。)
CFfile: このサーバ専用の自動分類ルールなどを保存するファイル名。
        (まだサポートしてません。)
Startup Folder Sync Mode:  スタートして最初の同期をどのようにとるか。
        Default: 仮想フォルダを使用していない場合 Quick scan を使う
                 仮想フォルダを使用していない場合 Full sync を使う
        Desginated folders only: \"Mailboxes to sync\" に設定された
                 mailbox のみを同期する。フラグが更新されるかどうか
                 はFlag synchronization option の値による。
        Quick scan: 隠されていない mailbox をすべてチェックし新しい
                 メールが来ていれば同期する。フラグの更新があったか
                 はチェックされない。同期にいく場合、フラグが更新
                 されるかどうかはFlag synchronization option の値
                 による。
        Full sync: 隠されていない mailbox はフラグの更新を含めて
                 同期される。
Folder Sync Mode: 新しいメールを取りにいくコマンドがフォルダ一覧
        モードで実行された時に(\\[cmail-folders-get-newmail])同期
        をどのようにとるか。値は Default を除き Startup Folder Sync
        Mode と同様。
Flag synchronization option: 新しいメッセージが到着しているなどで
        フォルダの同期をとるとき、Full sync 以外のオプションで
        フラグの同期をおこなうかどうかがきまる。 \"Sync flags as
        well\" の場合は、ローカルコピーにあるメッセージもフラグが
        サーバ上で更新されていれば同期される。そうでなければフラグ
        は更新しない。
Mailboxes to sync: フォルダ同期を行う mailbox 名の文字列の
        リスト。\"regexp: \" で始まる場合正規表現とみなされます。
        \"Mailboxes to hide\" が優先されます。
Default regexp for mailboxes to search: デフォルトの検索対象メール
        ボックスの名前にマッチする正規表現。cmail のフォルダではな
        くサーバ上のメールボックスの名前であることに注意。検索に
        際して入力を求められるのでその場で変更可能だが、Enter だけ
        で空文字列が入力された場合このデフォルトがメールボックスの
        選別に使用される。
Message fetch mode: メッセージがどのようにダウンロードされるかを
        指定する。
        Default: 仮想フォルダでは無い場合、大域変数の
                 `cmail-simap4-fetch-mode' の指定に従う。
                 仮想フォルダの場合、 Headers only/No cache を使用。
        Unspecified: 大域変数の `cmail-simap4-fetch-mode'
                 の指定に従う。
        Headers only: `cmail-simap4-fetch-mode' を参照
        Headers only/Local cache: `cmail-simap4-fetch-mode' を参照
        Partial Download: `cmail-simap4-fetch-mode' を参照
        Full Download: `cmail-simap4-fetch-mode' を参照
Message max size: メッセージのダウンロードを制限するために使用さ
        れる上限サイズ。単位 Byte.
Message part/body size: メッセージパートのダウンロードを制限する
        ために使用される上限サイズ。単位 Byte.
Connection Timeout: サーバに接続する時のタイムアウト値(秒)
Server Response Timeout: サーバの応答を待つ時のタイムアウト値(秒)
")
   (en_US . "\
*Server configuration for Simple IMAP4.

Each field has the following meaning.

Record Format: Version of the format of this variable. Cannot be modified.
Record State: Set to inactive to exculde this server from the active list.
Server: IMAP4 server name for this account.
UserID: IMAP4 user identification string on this server for this account.
TopDir: Local host directory for this account, which is a relative path
        from cmail-path. If this is set to an empty string,
        userid@servername will be used.
Virtual Folder: Whether or not local folders should be virtual folders
        to make them completely volatile. If virtual folders are used,
        when exiting cmail, all downloaded information during the session
        will be discarded, and complete synchronization would be done at
        the time of next access.
Mailboxes to Hide: A list of mailbox names which should be ignored when
        synchronizing the folders. A string starting with \"regexp: \"
        is considered as regular expression.
DraftMbox:  A name of IMAP4 mailbox, which is used to store draft
        messages. (Not yet supported.)
CFfile: A file name to save configuration such as auto refile rules
        specific to this account. (Not yet supported.)
Startup Folder Sync Mode:  Specify how default synchronization should
        be done during initial start up time.
        Default: For non-virtual folder case, Quick scan is used.
                 For virtual folder case, Full sync is used.
        Desginated folders only: Only those mailboxes specified in
                 \"Mailboxes to sync\" will be fully synchronized,
                 including flags. Depending on Flag synchronization
                 option, flags may or may not be synchronized.
        Quick scan: All non-hidden mailboxes are visited and checked if
                 any new arrived message is found. (No flag change is
                 scanned.) If new message is found, the mailbox will
                 be synchronized. Depending on Flag synchronization
                 option, flags may or may not be synchronized.
        Full sync: All non-hidden mailboxes are visited and checked if
                 any new arrived message and flag changes are found.
Folder Sync Mode:  Specify how default synchronization should be
        be done when get new message command is entered in folders mode
        buffer. (\\[cmail-folders-get-newmail]).
        See description option for Startup Folder Sync Mode. (Note:
        Default option in Startup Folder Sync Modeis not applicable.)
Flag synchronization option: When full sync is not the option
        for example, quick scan mode, if new arrived message is detected,
        the mailbox will be synchronized. If this option is set to
        \"Sync flags as well\", flags for the messages that exists on
        local copy are also synchronized.  Otherwise not, flags will not
        be updated and may show old status.  Note that if new message
        is retrieved, it will reflect initial flags.
Mailboxes to sync: A list of mailbox names which should be synched when
        synchronizing the folders. A string starting with \"regexp: \"
        is considered as regular expression.
Default regexp for mailboxes to search: A default regular expression
        that matches to mailboxes when IMAP4 on-server searching is
        used.  This is not the one matches to cmail folder names,
        but to mailbox names on the IMAP4 server. The user will be
        given a prompt for a change when search command is executed,
        but if an empty string is entered, this default is used to
        filter mailboxes.
Message fetch mode: Specifies how the messages should be downloaded
        for the 1st fetch.
        Default: For non-virtual folder case, follow global option
                 specified by `cmail-simap4-fetch-mode'.
                 For virtual folder case, Headers only/No cache mode
                 is used.
        Unspecified: follow global option specified by
                 `cmail-simap4-fetch-mode'.
        Headers only: Please see detailed info in
                 `cmail-simap4-fetch-mode'.
        Headers only/Local cache: Please see detailed info in
                 `cmail-simap4-fetch-mode'.
        Partial Download: Please see detailed info in
                 `cmail-simap4-fetch-mode'.
        Full Download: Please see detailed info in
                 `cmail-simap4-fetch-mode'.
Message max size: Message size in bytes used to determine whether to
        download message. 
Message part/body size: Message part size in bytes used to determine
        whether or not to download that part.
Connection Timeout: Timeout value in seconds used when opening a
        server connection.
Server Response Timeout: Timeout value in seconds used when waiting
        for a server response.
"))
  :type '(repeat
	  (list
	   (const :tag "Record Format: 1.2" "1.2")
	   (choice :tag "Record State"
		   (const :tag "Record active" nil)
		   (const :tag "Record inactive" t))
	   (string :tag "Server")
	   (string :tag "UserID")
	   (string :tag "TopDir")
	   (choice :tag "Virtual Folder"
		   (const :tag "Don't use virtual folder" nil)
		   (const :tag "Use virtual folder" t))
	   (repeat :tag "Mailboxes to Hide" (string))
	   (string :tag "DraftMbox")
	   (string :tag "CFfile")
	   (choice :tag "Startup Folder Sync Mode"
		   (const :tag "Default (See note)" default)
		   (const :tag "Designated folders only" spec-mbox-only)
		   (const :tag "Quick scan (See note)" quick-scan)
		   (const :tag "Full sync (See note)" full-sync)
		   )
	   (choice :tag "Folder Sync Mode"
		   (const :tag "Designated folders only" spec-mbox-only)
		   (const :tag "Quick scan (See note)" quick-scan)
		   (const :tag "Full sync (See note)" full-sync)
		   )
	   (choice :tag "Flag synchronization option"
		   (const :tag "Sync flags as well" t)
		   (const :tag "Don't sync flags" nil))
	   (repeat :tag "Mailboxes to sync (See notes)"
		   :value ("INBOX") (string))
	   (string :tag "Default regexp for mailboxes to search (See notes)"
		   :value "")
	   (choice :tag "Message fetch mode"
		   (const :tag "Default (See note)" default)
		   (const :tag "Unspecified (Use global option)" unspec)
		   (const :tag "Headers Only" headers-only)
		   (const :tag "Headers Only/Local cache" headers-only-lc)
		   (const :tag "Partial Download" partial-download)
		   (const :tag "Full Download" full-download)
		   )
	   (integer :tag "Message max size" 40000)
	   (integer :tag "Message part/body size" 8000)
	   (integer :tag "Connection Timeout" 60)
	   (integer :tag "Server Response Timeout" 20)
	   ))
  :group 'cmail-all-variables
  :group 'cmail-simap4-group)

(cmail-i18n-defcustom cmail-simap4-search-key-list
    '("TEXT" "FROM" "SUBJECT" "KEYWORD" "HEADER" 
      "FLAG" "TO" "CC" "BODY")
  ((ja_JP . "\
*検索文字列をたずねてくる検索キーの順番。

デフォルト以外の検索キーは使用出来ませんが、よく使うキーを先頭におくと
この順番に検索文字列をたずねてくるので少いキーストロークで検索できます。
")
   (en_US . "\
*Specifies the order of search key prompt.

Although search keys other than listed as default here will not work,
as it propmpts for search string in the order it appears in this list,
it may help reducing key strokes for search."))
  :type '(repeat (string))
  :group 'cmail-all-variables
  :group 'cmail-simap4-group)


(cmail-i18n-defcustom cmail-simap4-fetch-mode 'headers-only
  ((ja_JP . "\
*メッセージをどのように取り込むか。

現在は次のモードが存在する。

   ヘッダのみ (headers-only): メッセージがサーバ上でフォルダに新しく追
加された場合最初に RFC-822 ヘッダだけ取り込んでおいて自動アーカイブ等
を行う。本文は表示時に一部ダウンロードモードでその都度取り込まれセーブ
されない。高速線での常時接続で表示時のダウンロードがストレスにならない
場合、または大量のメールを読まずにタイトルで選択する場合等を想定してい
る。

   ヘッダのみ/本文ローカルキャッシュ (headers-only-lc): 基本的にヘッダ
のみのオプションと同じだが、表示時に取り込まれた本文はローカルのフォル
ダの一部としてキャッシュされる。

   一部ダウンロード (partial-download): サーバ設定オプションの最大メッ
セージサイズ \"Max message size\" の閾値よりメッセージが大きい場合、基
本的に 7bit の Text/plain のみをダウンロードして添付ファイルなどをダウ
ンロードしないモード。低速回線経由でほとんどののメールを取り込んでおい
てオフライン作業する場合を想定している。全文ダウンロードはサマリモード
からコマンドで実行できる。

   全文ダウンロード(full-download): 添付ファイルなどを含めた本文全てを
ダウンロードする。添付ファイルがそれほど無いか、高速回線で全ダウンロー
ドがそれほどストレスにならない場合でオフライン作業のためにメールをロー
カルにダウンロードする場合を想定している。")
   
   (en_US . "\
*Specifies how the messages should be downloaded.

A choice of the following.

    Headers Only (headers-only): Download message headers for quick
view and auto-archiving. The message body will be download in full
download mode when displayed. The downloaded body will not be
saved. This may be used when the server is always connected and
accessed through a high bandwidth network, and does not cause too much
trouble to download body on the fly.

    Headers Only/Local cache (headers-only-lc): Mostly the same as
Headers only mode, however, downloaded message will be cached as part
of local folder.

    Partial Download: When the message size is larger than the
threshold value specified by one of the server configuration options
\"Max message size\", download only parts of a message, mainly mime part
of text/Plain with 7bit transfer encoding, and will not download large
attachments. This may be used when the server is not always connected
and/or connected through a low bandwidth line, and you would like to
look at all the messages off-line anyway. Full download can be
performed from the summary mode if needed manually.

    Full Download: Download whole message including all the attachment
files. This may be used when you do not normally receive messages with
large attatchments, or the server is accessed through very high
bandwidth network and you do not care to download everything. (Or when
you have no chice because you need the attachments for off-line
meeting etc.)"))
  :type '(choice (const :tag "Headers only" headers-only)
		 (const :tag "Partial Download" partial-download)
		 (const :tag "Full Download" full-download))
  :group 'cmail-all-variables
  :group 'cmail-simap4-group)

(cmail-i18n-defcustom cmail-simap4-num-msg-cache 100
  ((ja_JP . "\
*headers-only 取込モードでいくつのメッセージをメモリにキャシュするか。")
   (en_US . "\
*Number of messages to cache in memory when headers-only mode is used."))
  :type 'integer
  :group 'cmail-all-variables
  :group 'cmail-simap4-group)


;;; (cmail-i18n-defcustom cmail-simap4-max-msg-size 20000
;;;   ((ja_JP . "\
;;; *メッセージのダウンロードを制限するために使用される上限サイズ。")
;;;    (en_US . "\
;;; *Message size used to determine whether to download message."))
;;;   :type 'integer
;;;   :group 'cmail-all-variables
;;;   :group 'cmail-simap4-group)

;;; (cmail-i18n-defcustom cmail-simap4-max-body-size 2000
;;;   ((ja_JP . "\
;;; *メッセージパートのダウンロードを制限するために使用される上限サイズ。")
;;;    (en_US . "\
;;; *Message part size used to determine whether to download part."))
;;;   :type 'integer
;;;   :group 'cmail-all-variables
;;;   :group 'cmail-simap4-group)

;;; (cmail-i18n-defcustom cmail-simap4-connection-timeout 60
;;;   ((ja_JP . "\
;;; *サーバに接続する時のタイムアウト値(秒)")
;;;    (en_US . "\
;;; *Timeout value in seconds used when opening a server connection."))
;;;   :type 'integer
;;;   :group 'cmail-all-variables
;;;   :group 'cmail-simap4-group)

;;; (cmail-i18n-defcustom cmail-simap4-command-timeout 20
;;;   ((ja_JP . "\
;;; *サーバの応答を待つ時のタイムアウト値(秒)")
;;;    (en_US . "\
;;; *Timeout value in seconds used when waiting for a server response."))
;;;   :type 'integer
;;;   :group 'cmail-all-variables
;;;   :group 'cmail-simap4-group)

;;; server option format conversion
(let ((specs cmail-simap4-servers)
      spec new-spec new-specs)
  (while specs
    (setq spec (car specs))
    (setq specs (cdr specs))
    (setq new-spec nil)
    (cond
     ;; current.
     ((string= (elt spec 0) "1.2"))
     ;; 1.1 to current update
     ((string= (elt spec 0) "1.1")
      (setq new-spec '("1.2"))
      (setq new-spec (cons (elt spec 1) new-spec))
      (setq new-spec (cons (elt spec 2) new-spec))
      (setq new-spec (cons (elt spec 3) new-spec))
      (setq new-spec (cons (elt spec 4) new-spec))
      (setq new-spec (cons (elt spec 5) new-spec))
      (setq new-spec (cons (elt spec 6) new-spec))
      (setq new-spec (cons (elt spec 7) new-spec))
      (setq new-spec (cons (elt spec 8) new-spec))
      (setq new-spec (cons (elt spec 9) new-spec))
      (setq new-spec (cons (elt spec 10) new-spec))
      (setq new-spec (cons (elt spec 11) new-spec))
      (setq new-spec (cons (elt spec 12) new-spec))
      (setq new-spec (cons "^INBOX.*" new-spec))
      (setq new-spec (cons (elt spec 13) new-spec))
      (setq new-spec (cons (elt spec 14) new-spec))
      (setq new-spec (cons (elt spec 15) new-spec))
      (setq new-spec (cons (elt spec 16) new-spec))
      (setq new-spec (cons (elt spec 17) new-spec))
      (setq new-specs (cons (reverse new-spec) new-specs)))
     ;; 1.0 to current update.
     ((string= (elt spec 0) "1.0")
      (setq new-spec '("1.2"))
      (setq new-spec (cons (elt spec 1) new-spec))
      (setq new-spec (cons (elt spec 2) new-spec))
      (setq new-spec (cons (elt spec 3) new-spec))
      (setq new-spec (cons (elt spec 4) new-spec))
      (setq new-spec (cons (elt spec 5) new-spec))
      (setq new-spec (cons (elt spec 6) new-spec))
      (setq new-spec (cons (elt spec 7) new-spec))
      (setq new-spec (cons (elt spec 8) new-spec))
      (setq new-spec (cons 'default new-spec))
      (setq new-spec (cons 'quick-scan new-spec))
      (setq new-spec (cons nil new-spec))
      (setq new-spec (cons '("INBOX") new-spec))
      (setq new-spec (cons "^INBOX.*" new-spec))
      (setq new-spec (cons 'default new-spec))
      (setq new-spec (cons 40000 new-spec))
      (setq new-spec (cons 8000 new-spec))
      (setq new-spec (cons 60 new-spec))
      (setq new-spec (cons 20 new-spec))
      (setq new-specs (cons (reverse new-spec) new-specs))
      )))
  (if new-specs
      ;; This may casue an error if older version on custom is used.
      (custom-set-variables
       (list 'cmail-simap4-servers
	     (list 'quote (reverse new-specs)) 'now))))

(defun cmail-use-simap4 nil)
(provide 'cmail-use-simap4)

;; end-of-file
