How is empty body defined? Would that be simply a .\r\n, with nothing at all
before it? It would be obvious to do this:
/* Find the message terminator. */
if (ringbuf[MOD(ringpos - 1, RING_SIZE)] == '\n'
&& ringbuf[MOD(ringpos - 2, RING_SIZE)] == '\r'
&& ringbuf[MOD(ringpos - 3, RING_SIZE)] == '.'
&& (ringbuf[MOD(ringpos - 4, RING_SIZE)] == '\n'
|| ringbuf[MOD(ringpos - 4), RING_SIZE)] == '\0')) {
But that has the potential to terminate if there's a null at the end of a line
in the middle of a message. What about *mem to see about the length?
/* Find the message terminator. */
if (ringbuf[MOD(ringpos - 1, RING_SIZE)] == '\n'
&& ringbuf[MOD(ringpos - 2, RING_SIZE)] == '\r'
&& ringbuf[MOD(ringpos - 3, RING_SIZE)] == '.'
&& (ringbuf[MOD(ringpos - 4, RING_SIZE)] == '\n'
|| (totalmem < 3 && usedmem < 3)) {
Aaron
Ilja Booij <[EMAIL PROTECTED]> said:
>
> I've found another error in the ringbuf code.
>
> It does not terminate when sending a message with an empty body. There's
> no problem when using dbmail-smtp, only using lmtp.
>
> Ilja
>
> _______________________________________________
> Dbmail-dev mailing list
> [email protected]
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
>
--