--- 1.16/check_rcpt.conf	2018-04-20 19:03:03.000000000 -0500
+++ 1.17/check_rcpt.conf	2018-05-24 00:30:05.000000000 -0500
@@ -4,17 +4,64 @@
     logwrite = $local_part@$domain skipped via esf_skip_recipients
 
   warn 
-    condition = ${if eq{$acl_m_spam_user}{nobody}}
+       condition = ${if eq{$acl_m_spam_user}{nobody}}
        set acl_m_do_user = ${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}
        condition = ${if exists{/home/$acl_m_do_user/.spamassassin/user_prefs}}
        set acl_m_spam_user = $acl_m_do_user
        set acl_m_spam_domain = $domain
 
   warn
+       condition = ${if !eq{$acl_m_esf_skip}{1}}
        hosts    = !+relay_hosts
        domains  = !+skip_rbl_domains
        dnslists = RBL_DNS_LIST
        set acl_m_easy69 = ${eval:$acl_m_easy69+EASY_DNS_BLACKLIST}
        add_header = BlacklistCheck: Blacklisted address, +EASY_DNS_BLACKLIST Spam score
 
-  warn delay = ${if eq {$acl_m_slow2}{1}{0s}{2s}}
+
+  ##########################
+  # Check SPF record - deny, decrement spam score, or add to score
+  # SPF tells us if server is a sending mailserver for that domain.
+
+  warn
+    set acl_m_slow1 = 0
+
+  drop
+    !authenticated = *
+    condition = ${if !eq{$acl_m_esf_skip}{1}}
+    condition = ${if >={EASY_SPF_FAIL}{EASY_HIGH_SCORE_DROP}}
+    spf = fail
+    message = SPF: $sender_host_address is not allowed to send mail from $sender_address_domain: $spf_smtp_comment
+
+  warn
+    !authenticated = *
+    condition = ${if !eq{$acl_m_esf_skip}{1}}
+    condition = ${if !eq{EASY_SPF_FAIL}{0}}
+    spf = fail
+    set acl_m_easy69 = ${eval:$acl_m_easy69+EASY_SPF_FAIL}
+    add_header = SPFCheck: Fail, EASY_SPF_FAIL Spam score
+
+  warn
+    !authenticated = *
+    condition = ${if !eq{$acl_m_esf_skip}{1}}
+    condition = ${if !eq{EASY_SPF_PASS}{0}}
+    spf	= pass
+    set acl_m_slow1 = 1
+    set acl_m_easy69 = ${eval:$acl_m_easy69+EASY_SPF_PASS}
+    add_header = SPFCheck: Server passes SPF test, EASY_SPF_PASS Spam score
+
+  warn
+    !authenticated = *
+    condition = ${if !eq{$acl_m_esf_skip}{1}}
+    condition = ${if !eq{EASY_SPF_SOFT_FAIL}{0}}
+    spf = softfail
+    set acl_m_easy69 = ${eval:$acl_m_easy69+EASY_SPF_SOFT_FAIL}
+    add_header = SPFCheck: Soft Fail, EASY_SPF_SOFT_FAIL Spam score
+
+
+  ##########################
+  # If sender IP is not that of one of sender's domain's mailservers, 
+  #  delay a bit.
+  # Throws off lots of mass mailers.  
+ 
+  warn delay = ${if eq {$acl_m_slow1}{1}{0s}{2s}}
