aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/spf.c
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-01-03 12:58:51 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-01-03 12:58:51 +0200
commit4d5448c0dd1f169d277bf2c62719134fc403d070 (patch)
treeb7f800c48febfd01fe98f86c4c9f9ede03722313 /src/plugins/spf.c
parent92959b6a37374404ce3ee903e5905caaf2e22719 (diff)
downloadrspamd-4d5448c0dd1f169d277bf2c62719134fc403d070.tar.gz
rspamd-4d5448c0dd1f169d277bf2c62719134fc403d070.zip
Unconditionally disable SPF for authenticated users
Diffstat (limited to 'src/plugins/spf.c')
-rw-r--r--src/plugins/spf.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/src/plugins/spf.c b/src/plugins/spf.c
index 362ab6c53..f672bf80d 100644
--- a/src/plugins/spf.c
+++ b/src/plugins/spf.c
@@ -353,25 +353,31 @@ spf_symbol_callback (struct rspamd_task *task, void *unused)
struct spf_resolved *l;
if (radix_find_compressed_addr (spf_module_ctx->whitelist_ip,
- task->from_addr) == RADIX_NO_VALUE) {
- domain = get_spf_domain (task);
- if (domain) {
- if ((l =
- rspamd_lru_hash_lookup (spf_module_ctx->spf_hash, domain,
- task->tv.tv_sec)) != NULL) {
- spf_record_ref (l);
- spf_check_list (l, task);
- spf_record_unref (l);
+ task->from_addr) != RADIX_NO_VALUE) {
+ return;
+ }
+
+ if (task->user != NULL) {
+ return;
+ }
+
+ domain = get_spf_domain (task);
+ if (domain) {
+ if ((l =
+ rspamd_lru_hash_lookup (spf_module_ctx->spf_hash, domain,
+ task->tv.tv_sec)) != NULL) {
+ spf_record_ref (l);
+ spf_check_list (l, task);
+ spf_record_unref (l);
+ }
+ else {
+ if (!resolve_spf (task, spf_plugin_callback)) {
+ msg_info_task ("cannot make spf request for [%s]",
+ task->message_id);
}
else {
- if (!resolve_spf (task, spf_plugin_callback)) {
- msg_info_task ("cannot make spf request for [%s]",
- task->message_id);
- }
- else {
- rspamd_session_add_event (task->s, spf_plugin_fin, NULL,
- spf_plugin_quark ());
- }
+ rspamd_session_add_event (task->s, spf_plugin_fin, NULL,
+ spf_plugin_quark ());
}
}
}