Forwarding Parameters in IMAP/POP3/LMTP/SMTP proxying¶
Dovecot supports proxying various pieces of information and even variables for various protocols when forwarding connection. It requires that the sender is listed under trusted_networks
. For IMAP, it uses the ID
command, for other protocols, XCLIENT
is used.
This feature is supported since v1.2, except for x-forward which was added in v2.2.29.
IMAP protocol¶
For IMAP protocol, this is done by extending the ID command. The maximum length of parameters to parse is 255 bytes. The parameters are forwarded as part of the ID command key-value list.
5 ID (x-originating-ip "127.0.0.1" x-originating-port "143"... )
Supported parameters¶
x-originating-ip
- Client IPx-originating-port
- Client portx-connected-ip
- Server IPx-connected-port
- Server portx-proxy-ttl
- TTL which is reduced by each hop, loop prevention. When TTL drops to 0, the connection is dropped.x-session-id / x-session-ext-id
- Session ID to be used.x-forward-<variable_name>
- Forwarded variable, see Config Variables
POP3 protocol¶
For POP3 protocol, this is done with custom XCLIENT
command which accepts a space separated list of key=value
parameters.
Supported parameters¶
ADDR
- Client IPPORT
- Client portSESSION
- Session IDTTL
- TTL which is reduced by each hop, loop prevention. When TTL drops to 0, the connection is dropped.FORWARD
- Base64 encodedkey=value
parameter to be stored.
SMTP/LMTP protocol¶
See http://www.postfix.org/XCLIENT_README.html
ADDR
- Client IP, IPV6: prefix is needed for IPv6.PORT
- Client portSESSION
- Session IDHELO
- Original HELO/EHLOLOGIN
- Original LOGIN valueTIMEOUT
- Original TIMEOUTTTL
- TTL which is reduced by each hop, loop prevention. When TTL drops to 0, the connection is dropped.PROTO
- Forwarded protocol, can be one of SMTP, ESTMP, LMTP.FORWARD
- Base64 encoded key=value parameter to be stored.