Introduce optional support to inject PROXY protocol headers after

opening IMAP TCP streams.

Version 1 (text based) and version 2 (binary) protocol header types are
supported. Supports both IPv4 and IPv6 style headers.

http://www.haproxy.org/download/1.6/doc/proxy-protocol.txt
This commit is contained in:
Christian Mollekopf
2022-07-14 15:04:16 +02:00
parent 38bf246b0d
commit 76154d27f2
3 changed files with 97 additions and 0 deletions

View File

@@ -155,12 +155,22 @@ $config['imap_auth_type'] = null;
// IMAP socket context options
// See http://php.net/manual/en/context.ssl.php
// The example below enables server certificate validation
//
// proxy_protocol is used to inject HAproxy style headers in the TCP stream
// See http://www.haproxy.org/download/1.6/doc/proxy-protocol.txt
//$config['imap_conn_options'] = [
// 'ssl' => [
// 'verify_peer' => true,
// 'verify_depth' => 3,
// 'cafile' => '/etc/openssl/certs/ca.crt',
// ],
// 'proxy_protocol' => 1 | 2 | [ // required (either version number (1|2) or array with 'version' key)
// 'version' => 1 | 2, // required, if array
// 'remote_addr' => $_SERVER['REMOTE_ADDR'],
// 'remote_port' => $_SERVER['REMOTE_PORT'],
// 'local_addr' => $_SERVER['SERVER_ADDR'],
// 'local_port' => $_SERVER['SERVER_PORT'],
// ],
// ];
// Note: These can be also specified as an array of options indexed by hostname
$config['imap_conn_options'] = null;