Lines 351-370
writeline(struct queue *queue, const char *line, ssize_t linelen)
Link Here
|
351 |
|
351 |
|
352 |
while (linelen > 0) { |
352 |
while (linelen > 0) { |
353 |
len = linelen; |
353 |
len = linelen; |
354 |
if (linelen > MAX_LINE_RFC822) { |
354 |
if (linelen >= MAX_LINE_RFC822) { |
355 |
len = MAX_LINE_RFC822 - 10; |
355 |
len = MAX_LINE_RFC822 - 2; |
356 |
} |
356 |
} |
357 |
|
357 |
|
358 |
if (fwrite(line, len, 1, queue->mailf) != 1) |
358 |
if (fwrite(line, len, 1, queue->mailf) != 1) |
359 |
return (-1); |
359 |
return (-1); |
360 |
|
360 |
|
361 |
if (linelen <= MAX_LINE_RFC822) |
361 |
if (linelen < MAX_LINE_RFC822) |
362 |
break; |
362 |
break; |
363 |
|
363 |
|
364 |
if (fwrite("\n", 1, 1, queue->mailf) != 1) |
364 |
if (fwrite("\n", 1, 1, queue->mailf) != 1) |
365 |
return (-1); |
365 |
return (-1); |
366 |
|
366 |
|
367 |
line += MAX_LINE_RFC822 - 10; |
367 |
line += MAX_LINE_RFC822 - 2; |
368 |
linelen = strlen(line); |
368 |
linelen = strlen(line); |
369 |
} |
369 |
} |
370 |
return (0); |
370 |
return (0); |
Lines 408-414
readmail(struct queue *queue, int nodot, int recp_from_header)
Link Here
|
408 |
break; |
408 |
break; |
409 |
|
409 |
|
410 |
if (!had_headers) { |
410 |
if (!had_headers) { |
411 |
if (linelen > MAX_LINE_RFC822) { |
411 |
if (linelen >= MAX_LINE_RFC822) { |
412 |
/* XXX also split headers */ |
412 |
/* XXX also split headers */ |
413 |
errlogx(EX_DATAERR, "bad mail input format:" |
413 |
errlogx(EX_DATAERR, "bad mail input format:" |
414 |
" from %s (uid %d) (envelope-from %s)", |
414 |
" from %s (uid %d) (envelope-from %s)", |