From da90e11b92539d22fd809d2442afcbbb5f2abec5 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Sat, 4 Oct 2008 22:35:29 +0000
Subject: [PATCH] Fix folded header field parsing bug in parse_msg_header(), if
 the folded data portion contained a colon, it would be interpretted as a new
 header field.

---
 exec/load/mailproc_util.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exec/load/mailproc_util.js b/exec/load/mailproc_util.js
index b98c1eacf0..3b828435a9 100644
--- a/exec/load/mailproc_util.js
+++ b/exec/load/mailproc_util.js
@@ -20,7 +20,7 @@ function parse_msg_header(msgtxt)
 	for(i in msgtxt) {
 		if(msgtxt[i].length==0)	// Header terminator
 			break;
-		var match = msgtxt[i].match(/(\S+)\s*:\s*(.*)/);
+		var match = msgtxt[i].match(/^(\S+)\s*:\s*(.*)/);
 		if(match)
 			hdr[last_field=match[1].toLowerCase()]=match[2];
 		else if(last_field)		// Folded header field
-- 
GitLab