dovecot-2.2: stats: Added session=<ID> filter to doveadm dump se...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Aug 7 12:31:16 UTC 2015
details: http://hg.dovecot.org/dovecot-2.2/rev/f611d66e56f6
changeset: 18924:f611d66e56f6
user: Timo Sirainen <tss at iki.fi>
date: Fri Aug 07 15:30:26 2015 +0300
description:
stats: Added session=<ID> filter to doveadm dump session|command
diffstat:
src/stats/client-export.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (40 lines):
diff -r 573118da2eaa -r f611d66e56f6 src/stats/client-export.c
--- a/src/stats/client-export.c Fri Aug 07 15:13:34 2015 +0300
+++ b/src/stats/client-export.c Fri Aug 07 15:30:26 2015 +0300
@@ -28,7 +28,7 @@
};
struct mail_export_filter {
- const char *user, *domain;
+ const char *user, *domain, *session;
struct ip_addr ip;
unsigned int ip_bits;
time_t since;
@@ -65,7 +65,7 @@
unsigned long l;
/* filters:
- user=<wildcard> | domain=<wildcard>
+ user=<wildcard> | domain=<wildcard> | session=<str>
ip=<ip>[/<mask>]
since=<timestamp>
connected
@@ -76,6 +76,8 @@
filter_r->user = p_strdup(pool, *args + 5);
else if (strncmp(*args, "domain=", 7) == 0)
filter_r->domain = p_strdup(pool, *args + 7);
+ else if (strncmp(*args, "session=", 8) == 0)
+ filter_r->session = p_strdup(pool, *args + 8);
else if (strncmp(*args, "ip=", 3) == 0) {
if (net_parse_range(*args + 3, &filter_r->ip,
&filter_r->ip_bits) < 0) {
@@ -134,6 +136,9 @@
return FALSE;
if (filter->since > session->last_update.tv_sec)
return FALSE;
+ if (filter->session != NULL &&
+ strcmp(session->id, filter->session) != 0)
+ return FALSE;
if (filter->user != NULL &&
!wildcard_match(session->user->name, filter->user))
return FALSE;
More information about the dovecot-cvs
mailing list