diff src/lib-storage/mail-storage.h @ 4041:9d7420b0e1ef HEAD

Make life easier for plugins: - Added MAILBOX_OPEN_SAVEONLY flag for mailbox_open(), which is set when mailbox is opened only for append/copy - Added a couple of MAIL_STORAGE_ERR_* string defines that should be used when giving visible errors to clients - Added failed-flag for mailbox_list_context, which plugins can directly set to make mail_storage_mailbox_list_deinit() return failure - Added mail_storage_get_mailbox_path() and mail_storage_get_mailbox_control_dir() to return locations for mailbox directories Also be more strict when validating mailbox names.
author Timo Sirainen <timo.sirainen@movial.fi>
date Wed, 22 Feb 2006 16:52:11 +0200
parents 539a58176e7b
children da1d65e064f8
line wrap: on
line diff
--- a/src/lib-storage/mail-storage.h	Wed Feb 22 15:58:43 2006 +0200
+++ b/src/lib-storage/mail-storage.h	Wed Feb 22 16:52:11 2006 +0200
@@ -33,13 +33,15 @@
 enum mailbox_open_flags {
 	/* Mailbox must not be modified even if asked */
 	MAILBOX_OPEN_READONLY		= 0x01,
+	/* Only saving/copying mails to mailbox works. */
+	MAILBOX_OPEN_SAVEONLY		= 0x02,
 	/* Any extra time consuming operations shouldn't be performed
 	   (eg. when opening mailbox just for STATUS). */
-	MAILBOX_OPEN_FAST		= 0x02,
+	MAILBOX_OPEN_FAST		= 0x04,
 	/* Don't reset MAIL_RECENT flags when syncing */
-	MAILBOX_OPEN_KEEP_RECENT	= 0x04,
+	MAILBOX_OPEN_KEEP_RECENT	= 0x08,
 	/* Don't create index files for the mailbox */
-	MAILBOX_OPEN_NO_INDEX_FILES	= 0x08
+	MAILBOX_OPEN_NO_INDEX_FILES	= 0x10
 };
 
 enum mailbox_list_flags {
@@ -293,6 +295,17 @@
 					bool *syntax_error_r,
 					bool *temporary_error_r);
 
+/* Returns path to the given mailbox, or NULL if mailbox doesn't exist in
+   filesystem. is_file_r is set to TRUE if returned path points to a file,
+   and FALSE if it points to a directory. If name is "", the root storage
+   directory is returned. */
+const char *mail_storage_get_mailbox_path(struct mail_storage *storage,
+					  const char *name, bool *is_file_r);
+/* Returns path to the control directory of the mailbox, or NULL if mailbox
+   doesn't exist in filesystem. */
+const char *mail_storage_get_mailbox_control_dir(struct mail_storage *storage,
+						 const char *name);
+
 /* Open a mailbox. If input stream is given, mailbox is opened read-only
    using it as a backend. If storage doesn't support stream backends and its
    tried to be used, NULL is returned.