P
P
p4s8x2011-07-01 21:10:16
PHP
p4s8x, 2011-07-01 21:10:16

Exim: 8192 character emails take noticeably longer to send

I send via SMTP locally.
letters up to 8192 in size go beyond 0.004, after 8192 go beyond 0.1, i.е. 25 times slower.
those. after sending the “DATA\r\n” command, I send the letter itself

. Since the number looks very artificial, I suspect that some setting is holding it somewhere. Tell me, in which direction should I look?

UPDATE :
I've been digging through Exim's files and found out that the leak occurs exclusively in Exim itself.
specifically
recieve.c:
data_file = fdopen(data_fd, "w+");
...
message_ended = read_message_data_smtp(data_file); < - this call eats all the time

static int
read_message_data_smtp(FILE *fout)
{
int ch_state = 0;
register int ch;
register int linelength = 0;

while ((ch = (receive_getc)()) != EOF)
{
if (ch == 0) body_zerocount++;
switch (ch_state)
{
case 0: /* After LF or CRLF */
if (ch == '.')
{
ch_state = 3;
continue; /* Don't ever write . after LF */
}
ch_state = 1;

/* Else fall through to handle as normal uschar. */

case 1: /* Normal state */
if (ch == '\n')
{
ch_state = 0;
body_linecount++;
if (linelength > max_received_linelength)
max_received_linelength = linelength;
linelength = -1;
}
else if (ch == '\r')
{
ch_state = 2;
continue;
}
break;

In this case,
int (*receive_getc)(void) = stdin_getc;
int
stdin_getc(void)
{
return getc(stdin);
}
- when the last (> 8000) piece is run in the loop, braking occurs abruptly, but I can’t understand the reason. Maybe the settings of the axis itself are worth looking at? FreeBSD 8.2-RELEASE is worth it.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
Fiery_Fenix, 2011-07-02
​​@Fiery_Fenix

It is very similar to the minimum size of the letter that falls under the antivirus / antispam. I don’t remember exactly, but it seems that the server Kaspersky has such a minimum size. Another suspicious one is the Exim constant DELIVER_OUT_BUFFER_SIZE, which by default is exactly 8192, but this is like a block size for sending, not for receiving.
The test option is to give 8192 bytes to fputs in a loop and see the result.

C
charon, 2011-07-02
@charon

give more code. What's in $data?

P
p4s8x, 2011-07-03
@p4s8x

I found out that the problem is at the Exim level, I updated the text of the question, I need the help of the sishniks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question