diff src/readpst.c @ 282:57c3bcf22c4f

ignore internet headers that don't seem to be real rfc822 headers
author Carl Byington <carl@five-ten-sg.com>
date Sun, 22 May 2011 16:40:01 -0700
parents d9b1e2e0f25a
children 898118c3675e
line wrap: on
line diff
--- a/src/readpst.c	Sun May 22 16:27:30 2011 -0700
+++ b/src/readpst.c	Sun May 22 16:40:01 2011 -0700
@@ -1089,13 +1089,18 @@
 {
     // headers are sometimes really bogus - they seem to be fragments of the
     // message body, so we only use them if they seem to be real rfc822 headers.
+    // this list is composed of ones that we have seen in real pst files.
+    // there are surely others. the problem is - given an arbitrary character
+    // string, is it a valid (or even reasonable) set of rfc822 headers?
     if (header) {
-        if ((strncasecmp(header, "Return-Path: ", 13) == 0) ||
-            (strncasecmp(header, "Received: ",    10) == 0) ||
-            (strncasecmp(header, "Subject: ",      9) == 0) ||
-            (strncasecmp(header, "Date: ",         6) == 0) ||
-            (strncasecmp(header, "From: ",         6) == 0) ||
-            (strncasecmp(header, "X-x: ",          5) == 0) ||
+        if ((strncasecmp(header, "X-Barracuda-URL: ", 17) == 0) ||
+            (strncasecmp(header, "X-ASG-Debug-ID: ",  16) == 0) ||
+            (strncasecmp(header, "Return-Path: ",     13) == 0) ||
+            (strncasecmp(header, "Received: ",        10) == 0) ||
+            (strncasecmp(header, "Subject: ",          9) == 0) ||
+            (strncasecmp(header, "Date: ",             6) == 0) ||
+            (strncasecmp(header, "From: ",             6) == 0) ||
+            (strncasecmp(header, "X-x: ",              5) == 0) ||
             (strncasecmp(header, "Microsoft Mail Internet Headers", 31) == 0)) {
             return 1;
         }