diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-09-15 18:29:25 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-09-15 18:29:25 +0100 |
commit | 010142fade619ba8ace48bc2746c1926ff815cb7 (patch) | |
tree | 2ed11f95ea844fb65fee6cace3b844c4a4dddf63 /src | |
parent | b77b28a818ae9ce1938b6050ac54d31f64c24519 (diff) | |
download | rspamd-010142fade619ba8ace48bc2746c1926ff815cb7.tar.gz rspamd-010142fade619ba8ace48bc2746c1926ff815cb7.zip |
Print 'from: ' in logs if a task has no `user` specified
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/protocol.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index a1dabfab0..c023f768a 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -1041,6 +1041,17 @@ rspamd_protocol_write_ucl (struct rspamd_task *task, GString *logbuf) if (task->user) { rspamd_printf_gstring (logbuf, "user: %s, ", task->user); } + else if (task->from_envelope) { + InternetAddress *ia; + + ia = internet_address_list_get_address (task->from_envelope, 0); + + if (ia && INTERNET_ADDRESS_IS_MAILBOX (ia)) { + InternetAddressMailbox *iamb = INTERNET_ADDRESS_MAILBOX (ia); + + rspamd_printf_gstring (logbuf, "from: %s, ", iamb->addr); + } + } } g_hash_table_iter_init (&hiter, task->results); |