How can we help?

Watch this space: Upcoming Help Centre Migration


Sender Policy Framework Checking for Exim with Mail::SPF

Nathan Salt -


I want to use Sender Policy Framework


  • On-Premise Server + WebMail Installations: Version 6.0 > Current Version
  • Webmail Only Installations: Version 6.0 > Current Version


SPFQuery binaries are not installed with Atmail natively.


When compiled with Exim, the libspf libraries can sometimes cause issues. Sometimes it is best to use the SPFQuery binaries for SPF support.

To use SPFQuery with Exim, just go through the following steps:

- download Mail::SPF from

- untar, install:

% tar xvfz Mail-SPF-v2.006.tar.gz
% cd Mail-SPF-v2.006
% perl Makefile.PL && make && make install

- open the /usr/local/atmail/mailserver/configure file (or where your Exim configuration file is located).

- find this line:

accept  local_parts   = postmaster
domains       = +local_domains

- below this, add:

# SPF Acl clause
warn  set acl_m1  = --ip-address=$sender_host_address  --mfrom=$sender_address --helo=$sender_helo_name
set acl_m1  = ${run{/usr/bin/spfquery $acl_m1}{$value}{fail}}

deny message    = SPF check fail. $sender_host_address is not allowed to send mail from $sender_address_domain.
condition   = ${if eq {$runrc}{1}{1}{0}}

- restart exim:

% killall -HUP exim

- you can also add this line to check for soft failures:

warn message    = SPF check soft fail. Your host is not set as an allowed sender for $sender_address_domain.     condition   = ${if eq {$runrc}{2}{1}{0}}




Contact our support team

+61 (7) 5357 6605