mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-19 02:29:40 +00:00
dma: limit lines to 998 characters
Per RFC2822 the maximum transmitted line length is "998 characters...
excluding the CRLF." In a file the maximum is 999 with the \n included.
Previously mail containing a line with exactly 999 characters would
bounce.
PR: 208261
Reported by: Helge Oldach
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 1a0dde338d
)
This commit is contained in:
parent
eb32eb2b45
commit
62a323ecbc
@ -43,7 +43,7 @@
|
||||
|
||||
#include "dma.h"
|
||||
|
||||
#define MAX_LINE_RFC822 1000
|
||||
#define MAX_LINE_RFC822 999 /* 998 characters plus \n */
|
||||
|
||||
void
|
||||
bounce(struct qitem *it, const char *reason)
|
||||
@ -378,7 +378,7 @@ readmail(struct queue *queue, int nodot, int recp_from_header)
|
||||
char *line = NULL;
|
||||
ssize_t linelen;
|
||||
size_t linecap = 0;
|
||||
char newline[MAX_LINE_RFC822];
|
||||
char newline[MAX_LINE_RFC822 + 1];
|
||||
size_t error;
|
||||
int had_headers = 0;
|
||||
int had_from = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user