summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-08-19 15:00:11 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-08-19 15:00:11 +0400
commit9bee3171888d00c741e58a7c3532bd04ed7b48c1 (patch)
treeaf41554a6a98166ef07db478ac89ff5a2944a618
parent0c7e9c8960e296d4b2a1e571a21929d2a16d5e18 (diff)
downloadrspamd-9bee3171888d00c741e58a7c3532bd04ed7b48c1.tar.gz
rspamd-9bee3171888d00c741e58a7c3532bd04ed7b48c1.zip
* Ignore rfc822 group addresses
-rw-r--r--src/expressions.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/expressions.c b/src/expressions.c
index 0d61f9ca2..c009ddc84 100644
--- a/src/expressions.c
+++ b/src/expressions.c
@@ -1265,13 +1265,18 @@ rspamd_recipients_distance (struct worker_task *task, GList * args, void *unused
i = 0;
while (cur) {
addr = internet_address_list_get_address (cur);
- ar[i].name = memory_pool_strdup (task->task_pool, internet_address_get_addr (addr));
- if (ar[i].name != NULL && (c = strchr (ar[i].name, '@')) != NULL) {
- *c = '\0';
- ar[i].addr = c + 1;
+ if (addr && internet_address_get_type (addr) == INTERNET_ADDRESS_NAME) {
+ ar[i].name = memory_pool_strdup (task->task_pool, internet_address_get_addr (addr));
+ if (ar[i].name != NULL && (c = strchr (ar[i].name, '@')) != NULL) {
+ *c = '\0';
+ ar[i].addr = c + 1;
+ }
+ cur = internet_address_list_next (cur);
+ i++;
+ }
+ else {
+ cur = internet_address_list_next (cur);
}
- cur = internet_address_list_next (cur);
- i++;
}
#endif