1
Subject: Fix for RFC822 folded header line field
2
From: https://sourceforge.net/tracker/?func=detail&aid=2816230&group_id=63555&atid=504404
4
$MirOS: ports/mailnews/bmf/patches/patch-lex_c,v 1.1 2009/07/03 09:14:12 tg Exp $
5
--- a/lex.c.orig Sun Oct 20 20:28:53 2002
6
+++ a/lex.c Fri Jul 3 09:06:51 2009
7
@@ -682,7 +682,7 @@ again:
8
void lex_passthru( lex_t* pthis, bool_t is_spam, double hits )
11
- bool_t in_headers = true;
12
+ bool_t ign_header = false;
14
assert( pthis->bom < pthis->buflen && pthis->eom <= pthis->buflen );
15
assert( pthis->bom <= pthis->eom );
16
@@ -701,7 +701,7 @@ void lex_passthru( lex_t* pthis, bool_t
19
/* existing headers */
20
- while( in_headers && pthis->pos < pthis->eom )
21
+ while( pthis->pos < pthis->eom )
23
cpchar pbuf = pthis->pbuf + pthis->pos;
25
@@ -722,9 +722,14 @@ void lex_passthru( lex_t* pthis, bool_t
28
/* write header, ignoring existing spam headers */
29
- if( strncasecmp( pbuf, "X-Spam-", 7 ) != 0 )
30
+ if( ign_header && (pbuf[0] == ' ' || pbuf[0] == '\t') )
31
+ /* continuation line of an ignored header */ ;
32
+ else if( strncasecmp( pbuf, "X-Spam-", 7 ) == 0 )
36
write( STDOUT_FILENO, pbuf, len );