From: Vsevolod Stakhov Date: Thu, 26 Feb 2015 11:58:37 +0000 (+0000) Subject: For SPF we might also want to check notify messages. X-Git-Tag: 0.9.0~615 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9107343a954cd68e9cf49a67f975dfa75a43e869;p=thirdparty%2Frspamd.git For SPF we might also want to check notify messages. --- diff --git a/src/libserver/spf.c b/src/libserver/spf.c index a11d032a2f..5868584a6b 100644 --- a/src/libserver/spf.c +++ b/src/libserver/spf.c @@ -1684,6 +1684,21 @@ resolve_spf (struct rspamd_task *task, spf_cb_t callback) return TRUE; } } + else if (task->helo != NULL && strchr (task->helo, '.') != NULL) { + /* For notifies we can check HELO identity and check SPF accrodingly */ + /* XXX: very poor check */ + rec->local_part = rspamd_mempool_strdup (task->task_pool, "postmaster"); + rec->cur_domain = task->helo; + rec->sender_domain = task->helo; + + if (make_dns_request (task->resolver, task->s, task->task_pool, + spf_dns_callback, + (void *)rec, RDNS_REQUEST_TXT, rec->cur_domain)) { + task->dns_requests++; + rec->requests_inflight++; + return TRUE; + } + } return FALSE; }