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 login_trusted_networks
. For
IMAP, it uses the ID
command, for other protocols, XCLIENT
is used.
This feature is supported since v1.2, except for parameter forwarding, which was added in v2.2.29.
IMAP protocol¶
For IMAP protocol, this is done by extending the ID (RFC 2971) command.
RFC Requirements
Maximum key length is 30 bytes.
Value strings MUST NOT be longer than 1024 octets.
Dovecot has exactly 1024 byte limit to values. Trying to send 1025 bytes results in “
BYE Input buffer full, aborting
” response.
Implementations MUST NOT send more than 30 field-value pairs.
That being said, there doesn’t seem to be any limit to number of field-value pairs Dovecot can accept. In a test of thousands of pairs sent to Dovecot, there was not any increased memory usage (since each key-value pair was read separately and then discarded when not used).
The parameters are forwarded as part of the ID command field-value list.
5 ID ("x-originating-ip" "127.0.0.1" "x-originating-port" "143" ...)
Supported Fields¶
Field |
Description |
---|---|
|
Client IP address |
|
Client port |
|
Server IP address |
|
Server port address |
|
TTL which is reduced by each hop, loop prevention. When TTL drops to 0, the connection is dropped. |
|
Session ID to be used. |
|
Forwarded variable, see Variables |
POP3 protocol¶
For POP3 protocol, this is done with custom XCLIENT
command which
accepts a space separated list of field=value parameters.
Warning
There is a 1024 byte line limit for the XCLIENT command when using POP3. Reaching this limit would cause the XCLIENT command to fail. This would be visible to the POP3 client as “-ERR Input buffer full, aborting” or some other AUTH error.
Supported Fields¶
Field |
Description |
---|---|
|
Client IP |
|
Client port |
|
Session ID |
|
TTL which is reduced by each hop, loop prevention. When TTL drops to 0, the connection is dropped. |
|
Base64-encoded, tab-separated list of |
SMTP/LMTP protocol¶
See https://www.postfix.org/XCLIENT_README.html
Supported Fields (SMTP & LMTP)¶
Field |
Description |
---|---|
|
Client IP; prefix ( |
|
Client port |
|
TTL which is reduced by each hop, loop prevention. When TTL drops to 0, the connection is dropped. |
|
Original |
|
Original |
|
Original |
|
Forwarded protocol: |
Supported Fields (SMTP/Submission ONLY)¶
Field |
Description |
---|---|
|
Base64-encoded, tab-separated list of |
|
Session ID |
LMTP¶
Additional parameters supported for the LMTP RCPT TO
command:
Parameter |
Description |
---|---|
|
Base64-encoded, tab-separated list of |