diff src/lib-storage/mail-storage.h @ 8077:6d51328896d6 HEAD

Added the concept of Global UIDs that are preserved across copies. They can be fetched, searched and specified for the save API. dbox format supports them correctly, but with maildir the base filename is used so maildir_copy_preserve_filename=yes is required to preserve GUIDs when copying.
author Timo Sirainen <tss@iki.fi>
date Thu, 07 Aug 2008 15:33:52 -0400
parents 8a068f879cd1
children db66611fd195
line wrap: on
line diff
--- a/src/lib-storage/mail-storage.h	Thu Aug 07 15:05:40 2008 -0400
+++ b/src/lib-storage/mail-storage.h	Thu Aug 07 15:33:52 2008 -0400
@@ -128,7 +128,8 @@
 	MAIL_FETCH_UIDL_FILE_NAME	= 0x00020000,
 	MAIL_FETCH_UIDL_BACKEND		= 0x00040000,
 	MAIL_FETCH_MAILBOX_NAME		= 0x00080000,
-	MAIL_FETCH_SEARCH_SCORE		= 0x00100000
+	MAIL_FETCH_SEARCH_SCORE		= 0x00100000,
+	MAIL_FETCH_GUID			= 0x00200000
 };
 
 enum mailbox_transaction_flags {
@@ -466,6 +467,10 @@
    specify the address in From_-line. */
 void mailbox_save_set_from_envelope(struct mail_save_context *ctx,
 				    const char *envelope);
+/* Set globally unique ID for the saved mail. A new GUID is generated by
+   default. This function should usually be called only when copying an
+   existing mail (or restoring a mail from backup). */
+void mailbox_save_set_guid(struct mail_save_context *ctx, const char *guid);
 /* If dest_mail is set, the saved message can be accessed using it. Note that
    setting it may require mailbox syncing, so don't set it unless you need
    it. Also you shouldn't try to access it before mailbox_save_finish() is