[Dovecot] stats plugin + UID command continuation

Mike Abbott michael.abbott at apple.com
Wed Oct 27 04:20:31 EEST 2010


When using the stats plugin for dovecot-2.0, UID commands that "continue" cause infinite recursion and crash.  For example, "A22 UID FETCH 151 BODY[]" when the body is 3MB or so always crashes.  For smaller messages, this command logs the duration twice.  Here is a patch to fix it:

--- stats-plugin.c.orig	2010-10-26 20:18:13.000000000 -0500
+++ stats-plugin.c	2010-10-26 20:19:10.000000000 -0500
@@ -197,6 +197,9 @@
 
 	commands = array_get_modifiable(&imap_commands, &count);
 	for (i = 0; i < count; i++) {
+		if (strcasecmp(commands[i].name, "UID") == 0)
+			continue;
+
 		hash_table_insert(orig_cmds, (char *)commands[i].name,
 				  commands[i].func);
 		commands[i].func = stats_command;



More information about the dovecot mailing list