dovecot-2.1: login_log_format_elements: Added %{real_rip} variable.
dovecot at dovecot.org
dovecot at dovecot.org
Thu Oct 18 06:23:35 EEST 2012
details: http://hg.dovecot.org/dovecot-2.1/rev/92364817f4ba
changeset: 14771:92364817f4ba
user: Timo Sirainen <tss at iki.fi>
date: Thu Oct 18 06:21:25 2012 +0300
description:
login_log_format_elements: Added %{real_rip} variable.
It differs from %r when Dovecot proxy sends an updated client IP address.
Patch by Jack Bates.
diffstat:
src/login-common/client-common.c | 3 +++
src/login-common/client-common.h | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
diffs (38 lines):
diff -r be50d12be960 -r 92364817f4ba src/login-common/client-common.c
--- a/src/login-common/client-common.c Thu Oct 18 06:00:18 2012 +0300
+++ b/src/login-common/client-common.c Thu Oct 18 06:21:25 2012 +0300
@@ -97,6 +97,7 @@
client->set = set;
client->local_ip = *local_ip;
client->ip = *remote_ip;
+ client->real_ip = *remote_ip;
client->fd = fd;
client->tls = ssl;
client->trusted = client_is_trusted(client);
@@ -429,6 +430,7 @@
{ 'k', NULL, "ssl_security" },
{ 'e', NULL, "mail_pid" },
{ '\0', NULL, "session" },
+ { '\0', NULL, "real_rip" },
{ '\0', NULL, NULL }
};
@@ -478,6 +480,7 @@
tab[13].value = client->mail_pid == 0 ? "" :
dec2str(client->mail_pid);
tab[14].value = client_get_session_id(client);
+ tab[15].value = net_ip2addr(&client->real_ip);
return tab;
}
diff -r be50d12be960 -r 92364817f4ba src/login-common/client-common.h
--- a/src/login-common/client-common.h Thu Oct 18 06:00:18 2012 +0300
+++ b/src/login-common/client-common.h Thu Oct 18 06:21:25 2012 +0300
@@ -88,6 +88,7 @@
struct ip_addr local_ip;
struct ip_addr ip;
+ struct ip_addr real_ip;
unsigned int local_port, remote_port;
struct ssl_proxy *ssl_proxy;
const struct login_settings *set;
More information about the dovecot-cvs
mailing list