From cab064bafd1b07e8dd45fb20c5d957dc991116fd Mon Sep 17 00:00:00 2001 From: Bron Gondwana Date: Wed, 24 Dec 2008 23:28:48 +1100 Subject: [PATCH] Accept 'From ' header from IMAP clients Hotmail used to create a 'From ' header and export it via IMAP. Outlook would send that header right up to the IMAP server. Yet another workaround for misbehaving clients. The bane of our existance they are, yes indeed. This patch causes any line starting with 'From ' in the header to be ignored rather than triggering a MESSAGE_BADHEADER error. --- imap/message.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/imap/message.c b/imap/message.c index 4da6ad2..ccc7d4d 100644 --- a/imap/message.c +++ b/imap/message.c @@ -315,6 +315,7 @@ int allow_null; /* Check for valid header name */ if (sawnl && buf[0] != ' ' && buf[0] != '\t') { if (buf[0] == ':') return IMAP_MESSAGE_BADHEADER; + if (strstr(buf, "From ") != buf) for (p = (unsigned char *)buf; *p != ':'; p++) { if (*p <= ' ') return IMAP_MESSAGE_BADHEADER; } -- 1.5.6.5