[Dovecot] proxy: get rid of redundant log-informations

Reindl Harald h.reindl at thelounge.net
Wed Sep 25 13:30:51 EEST 2013


Hi

Am 22.09.2013 03:13, schrieb Reindl Harald:
> Am 22.09.2013 02:20, schrieb Timo Sirainen:
>> %$ is the status, so you're asking for another status variable. Something like in the attached patch, where you can replace %$ with %{login_status}?
> 
> *exactly* that's it - many thanks!
> 
> %{login_status} -> ab[2].value = client->login_success ? "OK" : "Failed";
> in case of deeper debugging one can always set "%$" temporary
> 
> when we can get rid of "TLSv1 with cipher" and only have the cipher the log would become
> really tiny and easy to follow without too much linebreaking - not to forget the logsize
> in case of a lot of POP3 users every few minutes

nearly perfect
_______________________________________________________________________

2.2.6 with the patch:

Sep 25 12:22:26 testserver dovecot: pop3-login: OK: pop3 at testserver.rhsoft.net, 91.118.73.100, DIGEST-MD5, TLSv1
with cipher RC4-SHA (128/128 bits)
Sep 25 12:22:26 testserver dovecot: pop3-login: OK: pop3 at testserver.rhsoft.net, 91.118.73.100, DIGEST-MD5, TLSv1
with cipher RC4-SHA (128/128 bits)
_______________________________________________________________________

my dream:

Sep 25 12:22:26 testserver dovecot: pop3-login: OK: pop3 at testserver.rhsoft.net, 91.118.73.100, DIGEST-MD5, RC4-SHA
(128/128 bits)
Sep 25 12:22:26 testserver dovecot: pop3-login: OK (disconnecting): pop3 at testserver.rhsoft.net, 91.118.73.100,
DIGEST-MD5, RC4-SHA (128/128 bits)
_______________________________________________________________________

would allow rsyslog to skip the disconnect lines in case of OK and shorten the cipher output

:msg, contains, "OK (disconnecting)" ~
-------------- next part --------------
diff -r d400c1a673cf src/login-common/client-common.c
--- a/src/login-common/client-common.c	Sun Sep 22 03:17:12 2013 +0300
+++ b/src/login-common/client-common.c	Sun Sep 22 03:17:44 2013 +0300
@@ -561,9 +561,10 @@
 static const char *
 client_get_log_str(struct client *client, const char *msg)
 {
-	static struct var_expand_table static_tab[3] = {
+	static struct var_expand_table static_tab[] = {
 		{ 's', NULL, NULL },
 		{ '$', NULL, NULL },
+		{ '\0', NULL, "login_status" },
 		{ '\0', NULL, NULL }
 	};
 	const struct var_expand_table *var_expand_table;
@@ -603,6 +604,7 @@
 
 	tab[0].value = t_strdup(str_c(str));
 	tab[1].value = msg;
+	tab[2].value = client->login_success ? "OK" : "Failed";
 	str_truncate(str, 0);
 
 	var_expand(str, client->set->login_log_format, tab);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://dovecot.org/pipermail/dovecot/attachments/20130925/cdd2e431/attachment.bin>


More information about the dovecot mailing list