[dovecot-cvs] dovecot/src/lib-storage Makefile.am,1.5,1.6 mail-search.c,1.9,1.10 mail-search.h,1.7,1.8 mail-storage.h,1.30,1.31 mail-sort.c,1.12,NONE mail-sort.h,1.7,NONE mail-thread.c,1.8,NONE mail-thread.h,1.2,NONE

cras at procontrol.fi cras at procontrol.fi
Mon Jan 20 16:52:53 EET 2003


Update of /home/cvs/dovecot/src/lib-storage
In directory danu:/tmp/cvs-serv7093/lib-storage

Modified Files:
	Makefile.am mail-search.c mail-search.h mail-storage.h 
Removed Files:
	mail-sort.c mail-sort.h mail-thread.c mail-thread.h 
Log Message:
mail-storage.h interface changes, affects pretty much everything.
FETCH, SEARCH, SORT and THREAD handling were pretty much moved from
lib-storage/ to imap/ so adding non-index storages would be much easier now.
Also POP3 server can now be easily implemented with lib-storage.

Not too well tested, and at least one major problem: partial fetching is
_slow_.



Index: Makefile.am
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Makefile.am	8 Jan 2003 20:49:52 -0000	1.5
+++ Makefile.am	20 Jan 2003 14:52:51 -0000	1.6
@@ -9,12 +9,8 @@
 
 libstorage_a_SOURCES = \
 	mail-search.c \
-	mail-sort.c \
-	mail-storage.c \
-	mail-thread.c
+	mail-storage.c
 
 noinst_HEADERS = \
 	mail-search.h \
-	mail-sort.h \
-	mail-storage.h \
-	mail-thread.h
+	mail-storage.h

Index: mail-search.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/mail-search.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- mail-search.c	11 Jan 2003 19:55:57 -0000	1.9
+++ mail-search.c	20 Jan 2003 14:52:51 -0000	1.10
@@ -3,377 +3,6 @@
 #include "lib.h"
 #include "mail-search.h"
 
-struct search_build_data {
-	pool_t pool;
-	const char *error;
-};
-
-static struct mail_search_arg *
-search_arg_new(pool_t pool, enum mail_search_arg_type type)
-{
-	struct mail_search_arg *arg;
-
-	arg = p_new(pool, struct mail_search_arg, 1);
-	arg->type = type;
-
-	return arg;
-}
-
-#define ARG_NEW(type, value) \
-	arg_new(data, args, next_sarg, type, value)
-
-static int arg_new(struct search_build_data *data, struct imap_arg **args,
-		   struct mail_search_arg **next_sarg,
-		   enum mail_search_arg_type type, int value)
-{
-	struct mail_search_arg *sarg;
-
-	*next_sarg = sarg = search_arg_new(data->pool, type);
-	if (value == 0)
-		return TRUE;
-
-	/* first arg */
-	if ((*args)->type == IMAP_ARG_EOL) {
-		data->error = "Missing parameter for argument";
-		return FALSE;
-	}
-
-	if ((*args)->type != IMAP_ARG_ATOM &&
-	    (*args)->type != IMAP_ARG_STRING) {
-		data->error = "Invalid parameter for argument";
-		return FALSE;
-	}
-
-	sarg->value.str = str_ucase(IMAP_ARG_STR(*args));
-	*args += 1;
-
-	/* second arg */
-	if (value == 2) {
-		if ((*args)->type == IMAP_ARG_EOL) {
-			data->error = "Missing parameter for argument";
-			return FALSE;
-		}
-
-		if ((*args)->type != IMAP_ARG_ATOM &&
-		    (*args)->type != IMAP_ARG_STRING) {
-			data->error = "Invalid parameter for argument";
-			return FALSE;
-		}
-
-                sarg->hdr_field_name = sarg->value.str;
-		sarg->value.str = str_ucase(IMAP_ARG_STR(*args));
-		*args += 1;
-	}
-
-	return TRUE;
-}
-
-static int search_arg_build(struct search_build_data *data,
-			    struct imap_arg **args,
-			    struct mail_search_arg **next_sarg)
-{
-	struct mail_search_arg **subargs;
-	struct imap_arg *arg;
-	char *str;
-
-	if ((*args)->type == IMAP_ARG_EOL) {
-		data->error = "Missing argument";
-		return FALSE;
-	}
-
-	arg = *args;
-
-	if (arg->type == IMAP_ARG_NIL) {
-		/* NIL not allowed */
-		data->error = "NIL not allowed";
-		return FALSE;
-	}
-
-	if (arg->type == IMAP_ARG_LIST) {
-		struct imap_arg *listargs = IMAP_ARG_LIST(arg)->args;
-
-		*next_sarg = search_arg_new(data->pool, SEARCH_SUB);
-		subargs = &(*next_sarg)->value.subargs;
-		while (listargs->type != IMAP_ARG_EOL) {
-			if (!search_arg_build(data, &listargs, subargs))
-				return FALSE;
-			subargs = &(*subargs)->next;
-		}
-
-		*args += 1;
-		return TRUE;
-	}
-
-	i_assert(arg->type == IMAP_ARG_ATOM ||
-		 arg->type == IMAP_ARG_STRING);
-
-	/* string argument - get the name and jump to next */
-	str = IMAP_ARG_STR(arg);
-	*args += 1;
-	str_ucase(str);
-
-	switch (*str) {
-	case 'A':
-		if (strcmp(str, "ANSWERED") == 0)
-			return ARG_NEW(SEARCH_ANSWERED, 0);
-		else if (strcmp(str, "ALL") == 0)
-			return ARG_NEW(SEARCH_ALL, 0);
-		break;
-	case 'B':
-		if (strcmp(str, "BODY") == 0) {
-			/* <string> */
-			return ARG_NEW(SEARCH_BODY, 1);
-		} else if (strcmp(str, "BEFORE") == 0) {
-			/* <date> */
-			return ARG_NEW(SEARCH_BEFORE, 1);
-		} else if (strcmp(str, "BCC") == 0) {
-			/* <string> */
-			return ARG_NEW(SEARCH_BCC, 1);
-		}
-		break;
-	case 'C':
-		if (strcmp(str, "CC") == 0) {
-			/* <string> */
-			return ARG_NEW(SEARCH_CC, 1);
-		}
-		break;
-	case 'D':
-		if (strcmp(str, "DELETED") == 0)
-			return ARG_NEW(SEARCH_DELETED, 0);
-		else if (strcmp(str, "DRAFT") == 0)
-			return ARG_NEW(SEARCH_DRAFT, 0);
-		break;
-	case 'F':
-		if (strcmp(str, "FLAGGED") == 0)
-			return ARG_NEW(SEARCH_FLAGGED, 0);
-		else if (strcmp(str, "FROM") == 0) {
-			/* <string> */
-			return ARG_NEW(SEARCH_FROM, 1);
-		}
-		break;
-	case 'H':
-		if (strcmp(str, "HEADER") == 0) {
-			/* <field-name> <string> */
-			const char *key;
-
-			if ((*args)->type == IMAP_ARG_EOL) {
-				data->error = "Missing parameter for HEADER";
-				return FALSE;
-			}
-			if ((*args)->type != IMAP_ARG_ATOM &&
-			    (*args)->type != IMAP_ARG_STRING) {
-				data->error = "Invalid parameter for HEADER";
-				return FALSE;
-			}
-
-			key = str_ucase(IMAP_ARG_STR(*args));
-
-			if (strcmp(key, "FROM") == 0) {
-				*args += 1;
-				return ARG_NEW(SEARCH_FROM, 1);
-			} else if (strcmp(key, "TO") == 0) {
-				*args += 1;
-				return ARG_NEW(SEARCH_TO, 1);
-			} else if (strcmp(key, "CC") == 0) {
-				*args += 1;
-				return ARG_NEW(SEARCH_CC, 1);
-			} else if (strcmp(key, "BCC") == 0) {
-				*args += 1;
-				return ARG_NEW(SEARCH_BCC, 1);
-			} else if (strcmp(key, "SUBJECT") == 0) {
-				*args += 1;
-				return ARG_NEW(SEARCH_SUBJECT, 1);
-			} else if (strcmp(key, "IN-REPLY-TO") == 0) {
-				*args += 1;
-				return ARG_NEW(SEARCH_IN_REPLY_TO, 1);
-			} else if (strcmp(key, "MESSAGE-ID") == 0) {
-				*args += 1;
-				return ARG_NEW(SEARCH_MESSAGE_ID, 1);
-			} else {
-				return ARG_NEW(SEARCH_HEADER, 2);
-			}
-		}
-		break;
-	case 'K':
-		if (strcmp(str, "KEYWORD") == 0) {
-			/* <flag> */
-			return ARG_NEW(SEARCH_KEYWORD, 1);
-		}
-		break;
-	case 'L':
-		if (strcmp(str, "LARGER") == 0) {
-			/* <n> */
-			return ARG_NEW(SEARCH_LARGER, 1);
-		}
-		break;
-	case 'N':
-		if (strcmp(str, "NOT") == 0) {
-			if (!search_arg_build(data, args, next_sarg))
-				return FALSE;
-			(*next_sarg)->not = !(*next_sarg)->not;
-			return TRUE;
-		} else if (strcmp(str, "NEW") == 0) {
-			/* NEW == (RECENT UNSEEN) */
-			*next_sarg = search_arg_new(data->pool, SEARCH_SUB);
-
-			subargs = &(*next_sarg)->value.subargs;
-			*subargs = search_arg_new(data->pool, SEARCH_RECENT);
-			(*subargs)->next = search_arg_new(data->pool,
-							  SEARCH_SEEN);
-			(*subargs)->next->not = TRUE;
-			return TRUE;
-		}
-		break;
-	case 'O':
-		if (strcmp(str, "OR") == 0) {
-			/* <search-key1> <search-key2> */
-			*next_sarg = search_arg_new(data->pool, SEARCH_OR);
-
-			subargs = &(*next_sarg)->value.subargs;
-			for (;;) {
-				if (!search_arg_build(data, args, subargs))
-					return FALSE;
-
-				subargs = &(*subargs)->next;
-
-				/* <key> OR <key> OR ... <key> - put them all
-				   under one SEARCH_OR list. */
-				if ((*args)->type == IMAP_ARG_EOL)
-					break;
-
-				if ((*args)->type != IMAP_ARG_ATOM ||
-				    strcasecmp(IMAP_ARG_STR(*args), "OR") != 0)
-					break;
-
-				*args += 1;
-			}
-
-			if (!search_arg_build(data, args, subargs))
-				return FALSE;
-			return TRUE;
-		} if (strcmp(str, "ON") == 0) {
-			/* <date> */
-			return ARG_NEW(SEARCH_ON, 1);
-		} if (strcmp(str, "OLD") == 0) {
-			/* OLD == NOT RECENT */
-			if (!ARG_NEW(SEARCH_RECENT, 0))
-				return FALSE;
-
-			(*next_sarg)->not = TRUE;
-			return TRUE;
-		}
-		break;
-	case 'R':
-		if (strcmp(str, "RECENT") == 0)
-			return ARG_NEW(SEARCH_RECENT, 0);
-		break;
-	case 'S':
-		if (strcmp(str, "SEEN") == 0)
-			return ARG_NEW(SEARCH_SEEN, 0);
-		else if (strcmp(str, "SUBJECT") == 0) {
-			/* <string> */
-			return ARG_NEW(SEARCH_SUBJECT, 1);
-		} else if (strcmp(str, "SENTBEFORE") == 0) {
-			/* <date> */
-			return ARG_NEW(SEARCH_SENTBEFORE, 1);
-		} else if (strcmp(str, "SENTON") == 0) {
-			/* <date> */
-			return ARG_NEW(SEARCH_SENTON, 1);
-		} else if (strcmp(str, "SENTSINCE") == 0) {
-			/* <date> */
-			return ARG_NEW(SEARCH_SENTSINCE, 1);
-		} else if (strcmp(str, "SINCE") == 0) {
-			/* <date> */
-			return ARG_NEW(SEARCH_SINCE, 1);
-		} else if (strcmp(str, "SMALLER") == 0) {
-			/* <n> */
-			return ARG_NEW(SEARCH_SMALLER, 1);
-		}
-		break;
-	case 'T':
-		if (strcmp(str, "TEXT") == 0) {
-			/* <string> */
-			return ARG_NEW(SEARCH_TEXT, 1);
-		} else if (strcmp(str, "TO") == 0) {
-			/* <string> */
-			return ARG_NEW(SEARCH_TO, 1);
-		}
-		break;
-	case 'U':
-		if (strcmp(str, "UID") == 0) {
-			/* <message set> */
-			return ARG_NEW(SEARCH_UID, 1);
-		} else if (strcmp(str, "UNANSWERED") == 0) {
-			if (!ARG_NEW(SEARCH_ANSWERED, 0))
-				return FALSE;
-			(*next_sarg)->not = TRUE;
-			return TRUE;
-		} else if (strcmp(str, "UNDELETED") == 0) {
-			if (!ARG_NEW(SEARCH_DELETED, 0))
-				return FALSE;
-			(*next_sarg)->not = TRUE;
-			return TRUE;
-		} else if (strcmp(str, "UNDRAFT") == 0) {
-			if (!ARG_NEW(SEARCH_DRAFT, 0))
-				return FALSE;
-			(*next_sarg)->not = TRUE;
-			return TRUE;
-		} else if (strcmp(str, "UNFLAGGED") == 0) {
-			if (!ARG_NEW(SEARCH_FLAGGED, 0))
-				return FALSE;
-			(*next_sarg)->not = TRUE;
-			return TRUE;
-		} else if (strcmp(str, "UNKEYWORD") == 0) {
-			if (!ARG_NEW(SEARCH_KEYWORD, 0))
-				return FALSE;
-			(*next_sarg)->not = TRUE;
-			return TRUE;
-		} else if (strcmp(str, "UNSEEN") == 0) {
-			if (!ARG_NEW(SEARCH_SEEN, 0))
-				return FALSE;
-			(*next_sarg)->not = TRUE;
-			return TRUE;
-		}
-		break;
-	default:
-		if (*str == '*' || (*str >= '0' && *str <= '9')) {
-			/* <message-set> */
-			if (!ARG_NEW(SEARCH_SET, 0))
-				return FALSE;
-
-			(*next_sarg)->value.str = str;
-			return TRUE;
-		}
-		break;
-	}
-
-	data->error = t_strconcat("Unknown argument ", str, NULL);
-	return FALSE;
-}
-
-struct mail_search_arg *
-mail_search_args_build(pool_t pool, struct imap_arg *args, const char **error)
-{
-        struct search_build_data data;
-	struct mail_search_arg *first_sarg, **sargs;
-
-	data.pool = pool;
-	data.error = NULL;
-
-	/* get the first arg */
-	first_sarg = NULL; sargs = &first_sarg;
-	while (args->type != IMAP_ARG_EOL) {
-		if (!search_arg_build(&data, &args, sargs)) {
-			*error = data.error;
-			return NULL;
-		}
-		sargs = &(*sargs)->next;
-	}
-
-	*error = NULL;
-	return first_sarg;
-}
-
 void mail_search_args_reset(struct mail_search_arg *args)
 {
 	while (args != NULL) {

Index: mail-search.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/mail-search.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- mail-search.h	11 Jan 2003 19:55:57 -0000	1.7
+++ mail-search.h	20 Jan 2003 14:52:51 -0000	1.8
@@ -1,9 +1,6 @@
 #ifndef __MAIL_SEARCH_H
 #define __MAIL_SEARCH_H
 
-#include "imap-parser.h"
-#include "mail-storage.h"
-
 enum mail_search_arg_type {
 	SEARCH_OR,
 	SEARCH_SUB,
@@ -69,10 +66,6 @@
 
 typedef void (*mail_search_foreach_callback_t)(struct mail_search_arg *arg,
 					       void *context);
-
-/* Builds search arguments based on IMAP arguments. */
-struct mail_search_arg *
-mail_search_args_build(pool_t pool, struct imap_arg *args, const char **error);
 
 /* Reset the results in search arguments */
 void mail_search_args_reset(struct mail_search_arg *args);

Index: mail-storage.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/mail-storage.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- mail-storage.h	11 Jan 2003 19:55:57 -0000	1.30
+++ mail-storage.h	20 Jan 2003 14:52:51 -0000	1.31
@@ -1,6 +1,8 @@
 #ifndef __MAIL_STORAGE_H
 #define __MAIL_STORAGE_H
 
+struct message_size;
+
 #include "imap-util.h"
 
 enum mailbox_flags {
@@ -38,6 +40,9 @@
 };
 
 enum mail_sort_type {
+/* Maximum size for sort program, 2x for reverse + END */
+#define MAX_SORT_PROGRAM_SIZE (2*7 + 1)
+
 	MAIL_SORT_ARRIVAL	= 0x0010,
 	MAIL_SORT_CC		= 0x0020,
 	MAIL_SORT_DATE		= 0x0040,
@@ -57,11 +62,36 @@
 	MAIL_THREAD_REFERENCES
 };
 
+enum mail_fetch_field {
+	MAIL_FETCH_FLAGS		= 0x0001,
+	MAIL_FETCH_MESSAGE_PARTS	= 0x0002,
+
+	MAIL_FETCH_RECEIVED_DATE	= 0x0004,
+	MAIL_FETCH_DATE			= 0x0008,
+	MAIL_FETCH_SIZE			= 0x0010,
+
+	MAIL_FETCH_STREAM_HEADER	= 0x0020,
+	MAIL_FETCH_STREAM_BODY		= 0x0040,
+
+	/* specials: */
+	MAIL_FETCH_IMAP_BODY		= 0x1000,
+	MAIL_FETCH_IMAP_BODYSTRUCTURE	= 0x2000,
+	MAIL_FETCH_IMAP_ENVELOPE	= 0x4000
+};
+
+struct mail_full_flags {
+	enum mail_flags flags;
+
+	const char **custom_flags;
+	unsigned int custom_flags_count;
+};
+
 struct mail_storage;
 struct mail_storage_callbacks;
 struct mailbox_status;
-struct mail_fetch_data;
 struct mail_search_arg;
+struct fetch_context;
+struct search_context;
 
 typedef void (*mailbox_list_callback_t)(struct mail_storage *storage,
 					const char *name,
@@ -179,7 +209,7 @@
 	/* Update mail flags, calling update_flags callbacks. */
 	int (*update_flags)(struct mailbox *box,
 			    const char *messageset, int uidset,
-			    enum mail_flags flags, const char *custom_flags[],
+			    const struct mail_full_flags *flags,
 			    enum modify_type modify_type, int notify,
 			    int *all_found);
 
@@ -187,27 +217,62 @@
 	int (*copy)(struct mailbox *box, struct mailbox *destbox,
 		    const char *messageset, int uidset);
 
-	/* Fetch wanted mail data. The results are written into output stream
-	   in RFC2060 FETCH format. */
-	int (*fetch)(struct mailbox *box, struct mail_fetch_data *fetch_data,
-		     struct ostream *output, int *all_found);
+	/* Initialize new fetch request. wanted_fields isn't required, but it
+	   can be used for optimizations. If *update_seen is TRUE, \Seen flag
+	   is set for all fetched mails. *update_seen may be changed back to
+	   FALSE if all mails are already seen, or if it's not possible to
+	   change the flag (eg. read-only mailbox). */
+	struct mail_fetch_context *
+		(*fetch_init)(struct mailbox *box,
+			      enum mail_fetch_field wanted_fields,
+			      int *update_seen,
+			      const char *messageset, int uidset);
+	/* Deinitialize fetch request. all_found is set to TRUE if all of the
+	   fetched messages were found (ie. not just deleted). */
+	int (*fetch_deinit)(struct mail_fetch_context *ctx, int *all_found);
+	/* Fetch the next message. Returned mail object can be used until
+	   the next call to fetch_next() or fetch_deinit(). */
+	struct mail *(*fetch_next)(struct mail_fetch_context *ctx);
 
-	/* Search wanted mail data. args contains the search criteria.
-	   Results are written into output stream in RFC2060 SEARCH format.
-	   If charset is NULL, the given search strings are matched without
-	   any conversion. */
-	int (*search)(struct mailbox *box, const char *charset,
-		      struct mail_search_arg *args,
-		      enum mail_sort_type *sorting,
-		      enum mail_thread_type threading,
-		      struct ostream *output, int uid_result);
+	/* Simplified fetching for a single UID or sequence. Must be called
+	   between fetch_init() .. fetch_deinit() or
+	   search_init() .. search_deinit() */
+	struct mail *(*fetch_uid)(struct mailbox *box, unsigned int uid,
+				  enum mail_fetch_field wanted_fields);
+	struct mail *(*fetch_seq)(struct mailbox *box, unsigned int seq,
+				  enum mail_fetch_field wanted_fields);
+
+	/* Modify sort_program to specify a sort program acceptable for
+	   search_init(). If server supports no sorting, it's simply set to
+	   {MAIL_SORT_END}. */
+	int (*search_get_sorting)(struct mailbox *box,
+				  enum mail_sort_type *sort_program);
+	/* Initialize new search request. Search arguments are given so that
+	   the storage can optimize the searching as it wants.
+
+	   If sort_program is non-NULL, it requests that the returned messages
+	   are sorted by the given criteria. sort_program must have gone
+	   through search_get_sorting().
+
+	   wanted_fields and wanted_headers aren't required, but they can be
+	   used for optimizations. */
+	struct mail_search_context *
+		(*search_init)(struct mailbox *box, const char *charset,
+			       struct mail_search_arg *args,
+			       const enum mail_sort_type *sort_program,
+			       enum mail_fetch_field wanted_fields,
+			       const char *const wanted_headers[]);
+	/* Deinitialize search request. */
+	int (*search_deinit)(struct mail_search_context *ctx);
+	/* Search the next message. Returned mail object can be used until
+	   the next call to search_next() or search_deinit(). */
+	struct mail *(*search_next)(struct mail_search_context *ctx);
 
 	/* Save a new mail into mailbox. timezone_offset specifies the
-	   timezone in minutes which internal_date was originally given
+	   timezone in minutes which received_date was originally given
 	   with. */
-	int (*save)(struct mailbox *box, enum mail_flags flags,
-		    const char *custom_flags[],
-		    time_t internal_date, int timezone_offset,
+	int (*save)(struct mailbox *box, const struct mail_full_flags *flags,
+		    time_t received_date, int timezone_offset,
 		    struct istream *data, uoff_t data_size);
 
 	/* Returns TRUE if mailbox is now in inconsistent state, meaning that
@@ -224,6 +289,48 @@
 	unsigned int inconsistent:1;
 };
 
+struct mail {
+	/* always set */
+	unsigned int seq;
+	unsigned int uid;
+
+	unsigned int seen_updated:1; /* if update_seen was TRUE */
+
+	const struct mail_full_flags *(*get_flags)(struct mail *mail);
+	const struct message_part *(*get_parts)(struct mail *mail);
+
+	/* Get the time message was received (IMAP INTERNALDATE).
+	   Returns (time_t)-1 if error occured. */
+	time_t (*get_received_date)(struct mail *mail);
+	/* Get the Date-header in mail. Timezone is in minutes.
+	   Returns (time_t)-1 if error occured, 0 if field wasn't found or
+	   couldn't be parsed. */
+	time_t (*get_date)(struct mail *mail, int *timezone);
+	/* Get the full virtual size of mail (IMAP RFC822.SIZE).
+	   Returns (uoff_t)-1 if error occured */
+	uoff_t (*get_size)(struct mail *mail);
+
+	/* Get value for single header field */
+	const char *(*get_header)(struct mail *mail, const char *field);
+
+	/* Returns the parsed address for given header field. */
+	const struct message_address *(*get_address)(struct mail *mail,
+						     const char *field);
+	/* Returns the first mailbox (RFC2822 local-part) field for given
+	   address header field. */
+	const char *(*get_first_mailbox)(struct mail *mail, const char *field);
+
+	/* Returns input stream pointing to beginning of message header.
+	   hdr_size and body_size are updated unless they're NULL. */
+	struct istream *(*get_stream)(struct mail *mail,
+				      struct message_size *hdr_size,
+				      struct message_size *body_size);
+
+	/* Get the any of the "special" fields. */
+	const char *(*get_special)(struct mail *mail,
+				   enum mail_fetch_field field);
+};
+
 struct mailbox_status {
 	unsigned int messages;
 	unsigned int recent;
@@ -270,34 +377,6 @@
 				 unsigned int custom_flags_count,
 				 void *context);
 
-};
-
-struct mail_fetch_data {
-	const char *messageset;
-	unsigned int uidset:1;
-
-	unsigned int body:1;
-	unsigned int bodystructure:1;
-	unsigned int envelope:1;
-	unsigned int flags:1;
-	unsigned int internaldate:1;
-	unsigned int rfc822:1;
-	unsigned int rfc822_header:1;
-	unsigned int rfc822_size:1;
-	unsigned int rfc822_text:1;
-	unsigned int uid:1;
-
-	struct mail_fetch_body_data *body_sections;
-};
-
-struct mail_fetch_body_data {
-	struct mail_fetch_body_data *next;
-
-	const char *section; /* NOTE: always uppercased */
-	uoff_t skip, max_size; /* if you don't want max_size,
-	                          set it to (uoff_t)-1 */
-	unsigned int skip_set:1;
-	unsigned int peek:1;
 };
 
 /* register all mail storages */

--- mail-sort.c DELETED ---

--- mail-sort.h DELETED ---

--- mail-thread.c DELETED ---

--- mail-thread.h DELETED ---




More information about the dovecot-cvs mailing list