diff src/imap/main.c @ 1591:6eca99b727a0 HEAD

IMAP parser memory limits are now enforced by bytes per line rather than limiting maximum amount of tokens per line. Default is 64k now, which should help with the huge message sets generated by some clients.
author Timo Sirainen <tss@iki.fi>
date Wed, 02 Jul 2003 03:57:24 +0300
parents 898a95426118
children 9f503b7851ab
line wrap: on
line diff
--- a/src/imap/main.c	Tue Jul 01 22:17:02 2003 +0300
+++ b/src/imap/main.c	Wed Jul 02 03:57:24 2003 +0300
@@ -22,6 +22,7 @@
 
 struct ioloop *ioloop;
 unsigned int max_custom_flag_length, mailbox_check_interval;
+unsigned int imap_max_line_length;
 
 static struct module *modules;
 static char log_prefix[128]; /* syslog() needs this to be permanent */
@@ -127,6 +128,11 @@
 		}
 	}
 
+	str = getenv("IMAP_MAX_LINE_LENGTH");
+	imap_max_line_length = str != NULL ?
+		(unsigned int)strtoul(str, NULL, 10) :
+		DEFAULT_IMAP_MAX_LINE_LENGTH;
+
 	str = getenv("MAIL_MAX_FLAG_LENGTH");
 	max_custom_flag_length = str != NULL ?
 		(unsigned int)strtoul(str, NULL, 10) :