[dovecot-cvs] dovecot/src/lib-storage/index index-mail.c, 1.35, 1.36 index-mail.h, 1.12, 1.13

cras at procontrol.fi cras at procontrol.fi
Wed Jun 23 21:33:24 EEST 2004


Update of /home/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv6214/lib-storage/index

Modified Files:
	index-mail.c index-mail.h 
Log Message:
Added a framework for getting POP3 UIDL strings from mail-storage. The
default still is uidvalidity.uid. Added beginnings of overriding it from
X-UIDL header in mbox.



Index: index-mail.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-mail.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- index-mail.c	22 Jun 2004 07:36:33 -0000	1.35
+++ index-mail.c	23 Jun 2004 18:33:22 -0000	1.36
@@ -499,6 +499,13 @@
 		return data->envelope;
 	case MAIL_FETCH_FROM_ENVELOPE:
 		return NULL;
+	case MAIL_FETCH_UID_STRING:
+		if (data->uid_string == NULL) {
+			data->uid_string =
+				p_strdup_printf(mail->pool, "%u.%u",
+						mail->uid_validity, _mail->uid);
+		}
+		return data->uid_string;
 	default:
 		i_unreached();
 		return NULL;
@@ -510,9 +517,17 @@
 		     enum mail_fetch_field wanted_fields,
 		     const char *const wanted_headers[])
 {
+	const struct mail_index_header *hdr;
+	int ret;
+
 	mail->mail = *t->ibox->mail_interface;
 	mail->mail.box = &t->ibox->box;
 
+	ret = mail_index_get_header(t->ibox->view, &hdr);
+	i_assert(ret == 0);
+
+	mail->uid_validity = hdr->uid_validity;
+
 	mail->pool = pool_alloconly_create("index_mail", 16384);
 	mail->ibox = t->ibox;
 	mail->trans = t;

Index: index-mail.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-mail.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- index-mail.h	6 May 2004 01:22:25 -0000	1.12
+++ index-mail.h	23 Jun 2004 18:33:22 -0000	1.13
@@ -23,7 +23,7 @@
 	int header_save_idx;
 
 	struct message_part *parts;
-	const char *envelope, *body, *bodystructure;
+	const char *envelope, *body, *bodystructure, *uid_string;
 	struct message_part_envelope_data *envelope_data;
 
 	uint32_t seq;
@@ -57,6 +57,7 @@
 	struct index_transaction_context *trans;
 	unsigned int expunge_counter;
 	buffer_t *header_buf;
+	uint32_t uid_validity;
 
 	enum mail_fetch_field wanted_fields;
 	const char *const *wanted_headers;



More information about the dovecot-cvs mailing list