Claus Assmann:
> On Fri, Dec 02, 2011, Wietse Venema wrote:
> 
> > Will the wire protocol be:
> > 
> >     int32-pktlen SMFIR_PRDR int32-reply-count reply-text*
> 
> It will be your original suggestion:

That original suggestion was a mistake, as I pointed out later.

> int32-pkt-length SMFIR_PRDR nreplies int32-rcodes*nreplies rtext*nreplies
> where
> nreplies = int32-reply-count

This is inconsistent with the SMFIR_REPLY command.  That command
sends each (code, status, text) as one string instead of sending
numeric codes separately.  Inconsistency is one of the causes of
programmer error and security problems.

I propose instead:

    int32-pktlen SMFIR_PRDR int32-reply-count reply-text*

(BTW The int32-reply-count is redundant, it just is there to make
the protocol more robust).

> Each reply text must be formatted according to the RFCs,
> i.e., including CRLF and it can be multi-line:
> 
> smtp-code SP enhanced-status-code SP text \r\n

This is inconsistent with SMFIR_REPLY, which does not terminate the
reply with \r\n.  Inconsistency like this just introduces new
opportunities for programmer error and security holes.

I propose instead:

    smtp-code SP enhanced-status-code SP text NULL

for single-line responses, and

    smtp-code '-' enhanced-status-code SP text \r\n 
    smtp-code SP enhanced-status-code SP text NULL

for multi-line replies.

Sorry for being such a bitch, but I must insist that we don't
reinvent wheels and stick with the existing wheels that already
work in SMFIR_REPLY (I'm fine with dropping the '%' special handling).

        Wietse

Reply via email to