  ##########################
  # As usual, accept local and authenticated mail, no questions.
  accept hosts = +relay_hosts
    add_header = PrimaryMX: Accepted email from trusted host.  Hint: This skips spam scanning so make sure other host is not vulnerable

  accept authenticated = *

  warn set acl_m_spam_user = nobody
       set acl_m_spam_domain =

  ##########################
  # check for esf skip lists

  accept
    senders = +esf_skip_senders
    set acl_m_esf_skip = 1
    logwrite = $sender_address skipped via esf_skip_senders

  accept
    hosts = +esf_skip_hosts
    set acl_m_esf_skip = 1
    logwrite = $sender_address skipped via esf_skip_hosts

  ##########################
  # 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
    spf = fail
    message = SPF: $sender_host_address is not allowed to send mail from $sender_address_domain: $spf_smtp_comment

  warn
    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
    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

  warn set acl_m_slow2 = ${if or {{eq {$acl_m_slowy0}{1}} \
                             {eq {$acl_m_slow1}{1}}}{1}{0}}

  ##########################
  # No reverse DNS - add some spam score
  # Don't want to be tooo harsh here as this can sometimes fail.
  # FIXME: Use DNSDB lookup for this lookup instead..?
  #  Possible reason for failure: No local DNS server/remote too slow
  #  (Partial) Solution: Local Bind installed
  warn 
    condition = ${if eq {$sender_host_name}{} {1}{0}}
    set acl_m_easy69 = ${eval:$acl_m_easy69+EASY_NO_REVERSE_IP}
    add_header = ReverseDNS: No reverse DNS for mailserver, +EASY_NO_REVERSE_IP 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.  
  # We do this again later also.
  accept 
    condition = 1
    delay = ${if eq {$acl_m_slow2}{1}{0s}{2s}} 
  
