proxying = TRUE;
else if (strcmp(key, "host") == 0)
set->host = value;
- else if (strcmp(key, "port") == 0) {
+ else if (strcmp(key, "hostip") == 0) {
+ if (net_addr2ip(value, &set->hostip) < 0) {
+ i_error("proxy: Invalid hostip %s", value);
+ return FALSE;
+ }
+ } else if (strcmp(key, "port") == 0) {
if (net_str2port(value, &set->port) < 0) {
i_error("proxy: Invalid port number %s", value);
return FALSE;
if (set->port != client->local_port)
return FALSE;
- if (net_addr2ip(set->host, &ip) < 0)
- return FALSE;
+ if (set->hostip.family != 0)
+ ip = set->hostip;
+ else {
+ if (net_addr2ip(set->host, &ip) < 0)
+ return FALSE;
+ }
if (!net_ip_compare(&ip, &client->local_ip))
return FALSE;
return TRUE;
conn = p_new(proxy->pool, struct lmtp_proxy_connection, 1);
conn->proxy = proxy;
- conn->set.host = p_strdup(proxy->pool, set->host);
+ if (set->hostip.family == 0)
+ conn->set.host = p_strdup(proxy->pool, set->host);
+ else
+ conn->set.host = p_strdup(proxy->pool, net_ip2addr(&set->hostip));
conn->set.port = set->port;
conn->set.timeout_msecs = set->timeout_msecs;
array_append(&proxy->connections, &conn, 1);