[dovecot-cvs] dovecot/src/imap common.h,1.13,1.14 main.c,1.51,1.52
cras at dovecot.org
cras at dovecot.org
Sat Jul 10 20:24:10 EEST 2004
Update of /home/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv6888/src/imap
Modified Files:
common.h main.c
Log Message:
Split client_workarounds to imap_ and pop3_ ones. Added outlook-no-nuls POP3
workaround.
Index: common.h
===================================================================
RCS file: /home/cvs/dovecot/src/imap/common.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- common.h 2 May 2004 20:32:15 -0000 1.13
+++ common.h 10 Jul 2004 17:24:08 -0000 1.14
@@ -14,9 +14,15 @@
#define DEFAULT_MAX_KEYWORD_LENGTH 50
+enum client_workarounds {
+ WORKAROUND_OE6_FETCH_NO_NEWMAIL = 0x01,
+ WORKAROUND_OUTLOOK_IDLE = 0x02
+};
+
extern struct ioloop *ioloop;
extern unsigned int max_keyword_length, mailbox_check_interval;
extern unsigned int imap_max_line_length;
+extern enum client_workarounds client_workarounds;
extern string_t *capability_string;
Index: main.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/main.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- main.c 23 Jun 2004 17:48:35 -0000 1.51
+++ main.c 10 Jul 2004 17:24:08 -0000 1.52
@@ -21,9 +21,21 @@
#define IS_STANDALONE() \
(getenv("LOGGED_IN") == NULL && getenv("IMAPLOGINTAG") == NULL)
+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 },
+ { "outlook-idle", WORKAROUND_OUTLOOK_IDLE },
+ { NULL, 0 }
+};
+
struct ioloop *ioloop;
unsigned int max_keyword_length, mailbox_check_interval;
unsigned int imap_max_line_length;
+enum client_workarounds client_workarounds = 0;
static struct module *modules;
static char log_prefix[128]; /* syslog() needs this to be permanent */
@@ -39,6 +51,28 @@
io_loop_stop(ioloop);
}
+static void parse_workarounds(void)
+{
+ struct client_workaround_list *list;
+ const char *env, *const *str;
+
+ env = getenv("IMAP_CLIENT_WORKAROUNDS");
+ if (env == NULL)
+ return;
+
+ for (str = t_strsplit_spaces(env, " "); *str != NULL; str++) {
+ list = client_workaround_list;
+ for (; list->name != NULL; list++) {
+ if (strcasecmp(*str, list->name) == 0) {
+ client_workarounds |= list->num;
+ break;
+ }
+ }
+ if (list->name == NULL)
+ i_fatal("Unknown client workaround: %s", *str);
+ }
+}
+
static void open_logfile(void)
{
const char *user;
@@ -127,6 +161,8 @@
mailbox_check_interval = str == NULL ? 0 :
(unsigned int)strtoul(str, NULL, 10);
+ parse_workarounds();
+
namespace_pool = pool_alloconly_create("namespaces", 1024);
client = client_create(0, 1, namespace_init(namespace_pool, user));
More information about the dovecot-cvs
mailing list