Mark Martinec:
> While benchmarking a SMTP content filter, using smtp-source as a traffic
> generator and smtp-sink as sink, the message transfer rates were much
> worse than expected (about 100 seconds, instead of just a few seconds
> for 1000 messages).
> 
> It turned out the problem is in a TCP session over a loopback interface
> between a content filter and smtp-sink. When pipelining is used and all
> the MAIL FROM, RCPT TO, and DATA arrive in one packet, the smtp-sink
> responds in two packets: the first is a "250 2.1.0 Ok" response to a
> MAIL FROM command, and the second packet carries a response to
> the rest: "250 2.1.5 Ok\r\n354 End data with...\r\n".

Turning off the PIPELINING announcement should work. 

You may also try a global substition:

From:
    smtp_flush(state->stream);

To:
    SMTP_FLUSH(state->stream);

Where SMTP_FLUSH is defined as:

#define SMTP_FLUSH(fp) do { \
    if (vstream_peek(fp) <= 0 && readable(vstream_fileno(fp) <= 0) \
        smtp_flush(fp) \
    } while (0)

Sorry, no patch, because smtp-sink evolves randomly over time.

        Wietse

Reply via email to