[Limacute-commit] r231 - trunk/tools/cybar
jhf at projects.linpro.no
jhf at projects.linpro.no
Wed Jan 23 12:46:49 CET 2008
Author: jhf
Date: 2008-01-23 12:46:48 +0100 (Wed, 23 Jan 2008)
New Revision: 231
Modified:
trunk/tools/cybar/cybar.ml
Log:
Changed use of cyrreconstruct to avoid scanning entire mailstore of user.
Modified: trunk/tools/cybar/cybar.ml
===================================================================
--- trunk/tools/cybar/cybar.ml 2008-01-21 22:27:56 UTC (rev 230)
+++ trunk/tools/cybar/cybar.ml 2008-01-23 11:46:48 UTC (rev 231)
@@ -972,12 +972,16 @@
;;
(** Wildcard listing for cyrus of user with mailboxes *)
-let imap_wildcardfolders user =
+let imap_wildcardfolders ?relative_path user =
+ let relative_path = match relative_path with
+ | None -> ""
+ | Some relative_path -> options.hierarchysep^relative_path
+ in
let post = match user.domain with
| None -> ""
| Some domain -> "@" ^ domain
in
- "user"^options.hierarchysep^user.localpart^"*"^post
+ "user"^options.hierarchysep^user.localpart^relative_path^"*"^post
;;
(**
@@ -1990,8 +1994,10 @@
backup ~statistics ;
exists_or_create absolute_path ;
restore ~src:backup_dir ~dst:absolute_path ~cyrbase:("."^relative_path) ;
+ (* All folders are added to the list of known mailboxes *)
ignore(run ~input:mboxlines (options.ctl_mboxlist^" -u")) ;
- ignore(run (options.cyrreconstruct^" -rf "^(Filename.quote (imap_wildcardfolders user))));
+ (* Cyrus should now recognize the messages in the newly added folders *)
+ ignore(run (options.cyrreconstruct^" -rf "^(Filename.quote (imap_wildcardfolders ~relative_path user))));
let suffix = match user.domain with
| None -> ""
| Some domain -> "-d "^domain
More information about the Limacute-commit
mailing list