comparison src/readpst.c @ 278:06e723720db0

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 15:23:04 -0700
parents 86078d0c2e9c
children 8c2c7d8d7518
comparison
equal deleted inserted replaced
277:86078d0c2e9c 278:06e723720db0
1087 1087
1088 int valid_headers(char *header) 1088 int valid_headers(char *header)
1089 { 1089 {
1090 // headers are sometimes really bogus - they seem to be fragments of the 1090 // headers are sometimes really bogus - they seem to be fragments of the
1091 // message body, so we only use them if they seem to be real rfc822 headers. 1091 // message body, so we only use them if they seem to be real rfc822 headers.
1092 if ((strncasecmp(header, "Return-Path: ", 13) == 0) || 1092 if (header) {
1093 (strncasecmp(header, "Received: ", 10) == 0) || 1093 if ((strncasecmp(header, "Return-Path: ", 13) == 0) ||
1094 (strncasecmp(header, "From: ", 6) == 0)) { 1094 (strncasecmp(header, "Received: ", 10) == 0) ||
1095 } 1095 (strncasecmp(header, "From: ", 6) == 0)) {
1096 else { 1096 return 1;
1097 DEBUG_INFO(("Ignore bogus headers = \n%s\n", header)); 1097 }
1098 } 1098 else {
1099 DEBUG_INFO(("Ignore bogus headers = \n%s\n", header));
1100 return 0;
1101 }
1102 }
1103 else return 0;
1099 } 1104 }
1100 1105
1101 1106
1102 void header_has_field(char *header, char *field, int *flag) 1107 void header_has_field(char *header, char *field, int *flag)
1103 { 1108 {