masqmail

diff src/spool.c @ 75:257a9e6d1a8e

fixed correct processing of mails with data lines longer 4096 chars Mail messages with lines longer than 4096 chars were already read correctly, i.e. the spool files were correct. This commit fixes the reading of spool files with long lines. The old behavior was that the message body was truncated right before the first line longer 4096 chars. The number comes from MAX_DATALINE.
author meillo@marmaro.de
date Wed, 16 Jun 2010 19:06:34 +0200
parents 90644c204265
children 3b344bf57162
line diff
     1.1 --- a/src/spool.c	Wed Jun 16 10:39:44 2010 +0200
     1.2 +++ b/src/spool.c	Wed Jun 16 19:06:34 2010 +0200
     1.3 @@ -29,7 +29,9 @@
     1.4  
     1.5  	while ((c = getc(in)) != '\n' && (c != EOF)) {
     1.6  		if (p >= buf_len - 1) {
     1.7 -			return 0;
     1.8 +			buf[buf_len-1] = '\0';
     1.9 +			ungetc(c, in);
    1.10 +			return buf_len;
    1.11  		}
    1.12  		buf[p++] = c;
    1.13  	}