client-common.c revision 76b43e4417bab52e913da39b5f5bc2a130d3f149
5f5870385cff47efd2f58e7892f251cf13761528Timo Sirainen/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainenstatic const struct var_expand_table *
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen static struct var_expand_table static_tab[] = {
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen tab[1].value = t_strcut(client->virtual_user, '@');
04870054863757edf048c81dcce3c5e7dec453cdTimo Sirainen tab[2].value = strchr(client->virtual_user, '@');
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen tab[5].value = net_ip2addr(&client->local_ip);
bd63b5b860658b01b1f46f26d406e1e4a9dc019aTimo Sirainen tab[8].value = client->auth_mech_name == NULL ? NULL :
15a07b47846c47a81d69a14d649564e222d6f742Timo Sirainen str_sanitize(client->auth_mech_name, MAX_MECH_NAME);
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen tab[11].value = client->secured ? "secured" : NULL;
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen ssl_proxy_is_handshaked(client->proxy) ? "TLS" :
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen "TLS handshaking";
0df9428baed48afaff90b4d4f03792d2fd756a43Timo Sirainenstatic bool have_key(const struct var_expand_table *table, const char *str)
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen unsigned int i;
eacce2276278ce6a8176a9a100807dba50bbfb36Timo Sirainenstatic void client_syslog_real(struct client *client, const char *msg)
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen static struct var_expand_table static_tab[3] = {
e1203014de25c8c3d3975a9f4b4a04616df4bba2Timo Sirainen const struct var_expand_table *var_expand_table;
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen const char *p, *const *e;
e10d8b1291090c26b9ef499637e6e632485ca5beTimo Sirainen var_expand_table = get_var_expand_table(client);
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen for (e = log_format_elements; *e != NULL; e++) {
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen for (p = *e; *p != '\0'; p++) {
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainenvoid client_syslog(struct client *client, const char *msg)