diff src/libpst.c @ 252:4573b536177f

fix for broken internet headers from Outlook
author Carl Byington <carl@five-ten-sg.com>
date Sat, 24 Jul 2010 12:07:56 -0700
parents 67b24d6a45d6
children c947b8812120
line wrap: on
line diff
--- a/src/libpst.c	Wed Jul 07 16:29:23 2010 -0700
+++ b/src/libpst.c	Sat Jul 24 12:07:56 2010 -0700
@@ -2370,6 +2370,15 @@
                     break;
                 case 0x007D: // PR_TRANSPORT_MESSAGE_HEADERS Internet Header
                     LIST_COPY_EMAIL_STR("Internet Header", item->email->header);
+                    if (item->email->header.str && item->email->header.str[0] == '\r') {
+                        // broken outlook internet headers
+                        const char* fix = "Received: header broken by outlook fixup by libpst";
+                        char *str = pst_malloc(strlen(fix) + strlen(item->email->header.str) + 1);
+                        strcpy(str, fix);
+                        strcat(str, item->email->header.str);
+                        free(item->email->header.str);
+                        item->email->header.str = str;
+                    }
                     break;
                 case 0x0C04: // PR_NDR_REASON_CODE
                     LIST_COPY_EMAIL_INT32("NDR reason code", item->email->ndr_reason_code);