[dovecot-cvs] dovecot/src/lib-storage mail-storage.c,1.7,1.8 mail-storage.h,1.33,1.34

cras at procontrol.fi cras at procontrol.fi
Tue Feb 11 12:30:31 EET 2003


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

Modified Files:
	mail-storage.c mail-storage.h 
Log Message:
Added client_workarounds setting, with currently one workaround for OE6.



Index: mail-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/mail-storage.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- mail-storage.c	5 Jan 2003 13:09:52 -0000	1.7
+++ mail-storage.c	11 Feb 2003 10:30:29 -0000	1.8
@@ -4,6 +4,7 @@
 #include "ioloop.h"
 #include "mail-storage.h"
 
+#include <stdlib.h>
 #include <time.h>
 #include <ctype.h>
 
@@ -15,7 +16,39 @@
 	struct mail_storage *storage;
 };
 
+struct client_workaround_list {
+	const char *name;
+	enum client_workarounds num;
+};
+
+struct client_workaround_list client_workaround_list[] = {
+	{ "oe6-fetch-no-newmail", WORKAROUND_OE6_FETCH_NO_NEWMAIL },
+	{ NULL, 0 }
+};
+
 static struct mail_storage_list *storages = NULL;
+enum client_workarounds client_workarounds = 0;
+
+void mail_storage_init(void)
+{
+        struct client_workaround_list *list;
+	const char *env;
+	const char *const *str;
+
+	env = getenv("CLIENT_WORKAROUNDS");
+	if (env == NULL)
+		return;
+
+	for (str = t_strsplit(env, " "); *str != NULL; str++) {
+                list = client_workaround_list;
+		for (; list->name != NULL; list++) {
+			if (strcasecmp(*str, list->name) == 0)
+				client_workarounds |= list->num;
+			else
+				i_fatal("Unknown client workaround: %s", *str);
+		}
+	}
+}
 
 void mail_storage_class_register(struct mail_storage *storage_class)
 {

Index: mail-storage.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/mail-storage.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- mail-storage.h	27 Jan 2003 02:00:00 -0000	1.33
+++ mail-storage.h	11 Feb 2003 10:30:29 -0000	1.34
@@ -79,6 +79,10 @@
 	MAIL_FETCH_IMAP_ENVELOPE	= 0x4000
 };
 
+enum client_workarounds {
+	WORKAROUND_OE6_FETCH_NO_NEWMAIL
+};
+
 struct mail_full_flags {
 	enum mail_flags flags;
 
@@ -388,6 +392,11 @@
 				 void *context);
 
 };
+
+extern enum client_workarounds client_workarounds;
+
+/* Initialize mail storage. */
+void mail_storage_init(void);
 
 /* register all mail storages */
 void mail_storage_register_all(void);




More information about the dovecot-cvs mailing list