};
struct mail_export_filter {
- const char *user, *domain;
+ const char *user, *domain, *session;
struct ip_addr ip;
unsigned int ip_bits;
time_t since;
unsigned long l;
/* filters:
- user=<wildcard> | domain=<wildcard>
+ user=<wildcard> | domain=<wildcard> | session=<str>
ip=<ip>[/<mask>]
since=<timestamp>
connected
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) {
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;