Phil Vandry:
> On Tue, Jan 17, 2012 at 06:57:57AM -0500, Wietse Venema wrote:
> > Postfix allows a client to connect to the server through a proxy.
> > Naively doing a getsockname() call on the SMTP server's file
> > descriptor would produce an incorrect result (the port of the
> > proxy-to-Postfix connection).  The correct result uses the port
> > (and IP address) of the client-to-proxy connection. And that is
> > just one scenario that uses ports and that you weren't aware of.
> 
> Understood. Yet I didn't add the getsockname(). It was already there.
> Presumably that means that the server IP address that is
> handed to Dovecot was already wrong (under some circumstances).

The getsockname() call was already clearly flagged in the code with
XXX as a temporary workaround that doesn't belong there.

I worked on proxied client support several years later. And since
this getsockname() call was hidden in a place where it does not
belong, this call was overlooked, resulting in broken code.

So now you have seen with your own eyes how bad temporay hacks are.
They just make a big stinking mess of the system. I've spent the
last one-third of the Postfix 2.9 development cycle cleaning up.

        Wietse

Reply via email to