Claus Assmann:
> On Fri, Nov 25, 2011, Wietse Venema wrote:
> 
> > > > pkt-length command nreplies rcodes*nreplies 
> > > > null-terminated-rtext*nreplies
> 
> > Actually we can forget about the rcodes*nreplies part. 
> 
> > The rcode isn't sent with SMFIR_REPLY, so it should not be sent
> > with SMFIR_REPLIES either. With SMFIR_REPLY all three reply arguments
> > are inside the rtext.
> 
> Yes, but the API allows to omit the text:
> 
> ! int
> ! smfi_setreplies(SMFICTX *ctx, unsigned int nreplies, int *rcodes, const 
> char **rtexts)
> ! rcodes: a status array of size nreplies, each element must be one of
> ! SMFIS_TEMPFAIL, SMFIS_REJECT, SMFIS_ACCEPT
> 
> ! rtexts: a text array of size nreplies, each element must be either
> ! NULL or a valid SMTP reply text which matches the corresponding rcode,
> [1]

I'm sure libmilter API users will appreciate that the API for PDPR
replies is consistent with that of smfi_setreply / smfi_setmlreply.

I care primarily that the on-the-wire format is consistent with
SMFIR_REPLY, which transits one reply (including code, enhanced
status, text) as one string whether the reply is multiline or not,
and with the same special handling of % characters.

We're simply receiving N replies instead of just one; there is no
need to introduce new formatting.

By the way, sending the counter is redundant. We could drop it as
the Sendmail Milter protocol does not send a counter ahead of an
array of name/value macros, either.

Thus, I simply the proposed format to: 

    pkt-length SMFIR_REPLIES null-terminated-text+

with one or more null-terminated-text instances, formatted as with
SMFIR_REPLY.  The receiver will figure out how many replies there
are, and it can take appropriate action if the number is wrong, or
if the last reply was truncated.

        Wietse

Reply via email to