Loading...

postfix-devel@postfix.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Sending the local TCP port with Dovecot SASL Wietse Venema Wed Feb 01 22:02:12 2012

Phil Vandry:
> Hello Postfix developpers,
> 
> When Postfix sends a SASL authentication request to Dovecot,
> it includes the local IP address and remote IP address of the TCP
> connection. Dovecot also supports receiving the local and remote TCP
> ports (and other things besides) but Postfix doesn't send them.
> 
> I have a use case where Postfix is listining on hundreds of different
> TCP ports, and Dovecot needs to know on which SMTP server the connection
> was received in order to authenticate the user.
> 
> It isn't difficult to add the local TCP port number to the Dovecot
> SASL request. May I suggest that this be added?

You may suggest, but you may not know what you're asking for.  Adding
server (local) port support to Postfix was discussed a few weeks
ago here.

For consistency server port support needs to work in the exact same
way as the existing code for client (remote) port support.  According
to "grep -i client_port" there are 139 lines of code with "client_port"
or "CLIENT_PORT", over 39 different C source or include files
(including the embedded manpages in those files). Similar code would
be needed for server port support without WTF surprises.

The large code footprint is the result of many different contexts
where the information is used; it won't siply shrink with "better"
code decomposition.  The contexts range from server-side XCLIENT and
XFORWARD support in smtpd(8), code that writes or reads queue files
in cleanup(8) and qmgr(8), code that sends or receives delivery
requests between qmgr(8) and delivery agents, to client-side XFORWARD
support in smtp(8) and smtpd(8) (the latter to support before-queue
content filters).

        Wietse