John Fawcett:
> > I would not log this for EVERY command. Especially because the
> > logged text size by far exceeds the command size (each logfile
> > record takes ~100 bytes, while the client needs to send only four
> > characters plus CRLF.
> >
> > For example, Postfix logs pipelining errors including evidence, but
> > it logs this at most once per session, to avoid flooding the log
> > with garbage.
> 
> I have added a flag similar to the pipelining one, so that the warning
> is output once only per session no matter how many commands are issued
> prior to running STARTTLS.

Looks better, but I wonder if this could be done in a similar way
as, or combined with, the disconnect statistics. Strawman:

disconnect from host[addr] ehlo=1 mail=0/1 quit=1 commands=3 
errors=pipelining,plaintext

It puts all the stats in one place, and also minimizes the amount
of additional logfile space.

> > Even if you log this only once per session, it would blame the wrong
> > command (cmdp->name), because the protocol error bit may have been
> > set when the client sent an unknown command, and that code path never
> > reaches the code fragment shown above.
> 
> I updated the patch so it logs a generic message just once per session.
> I admit it doesn't add much to the info already available in the
> disconnect line, but it is an explicit indication of an error in the
> session, even when notify_classes are set to not send notifications to
> the postmaster.

Indeed, this very much duplicates information in the command summary line.
I wonder if we need to teach the world a new search pattern for that.

> I am attaching a new diff as a text file, hopefully it will get through
> the mail system better.

This patch didn't have messed-up whitespace with UTF8 code points.

        Wietse

Reply via email to