Get country from reverse dns country tld or from MaxMind GeoIP if not possible (minimizes GeoIP outdated database records). Requires GeoIP C API.
Usage: ${dlfunc{/usr/local/exim/exim-ext.so}{ip2country}{$sender_host_address}}
returns: 2 letter iso code for given ip address or "--" if not found.
Return given enviroment variable content.
Usage: ${dlfunc{/usr/local/exim/exim-ext.so}{get_env}{PATH}}
returns: enviroment variable content "" if not found.
Runs program injecting current message or file into it's stdin and returning the stdout output.
Usage: ${dlfunc{/usr/local/exim/exim-ext.so}{pipe_message}{app}{file}}
If {file} is ommited, the current message is piped to the application.
returns: application stdout output.
DSpam usage example::
# the trick here is to call dspam in deliver=summary mode, which will
# return only the dspam header, so you only need to add this header
# to the message (no need to reinject it):
warn set acl_m13 = ${dlfunc{/usr/local/exim/exim-ext.so}{pipe_message}\
{/usr/local/bin/dspam --deliver=summary --client \
--mode=teft --user global}}
set acl_m14 = ${extract {result}{$acl_m13}}
set acl_m15 = ${extract {signature}{$acl_m13}}
# now you get in acl_m13 the dspam header, the signature in acl_m15
# (if you need it for logging or something else) and the result
# in acl_m14
# you could optionally retrain it if it comes from a very trusted sender:
warn condition = [VERY TRUSTED SENDER]
condition = ${if match {$acl_m14}{Spam}}
set acl_m13 = ${dlfunc{/usr/local/exim/exim-ext.so}{pipe_message}\
{/usr/local/bin/dspam --user global --client \
--class=innocent --source=error \
--deliver=summary --signature=$acl_m15}}
set acl_m14 = Innocent (retrained)
set acl_m15 =
# deny at SMTP time if it's spam:
deny condition = ${if match {$acl_m14}{Spam}}
message = Spam not welcome
# and if accepted add the proper header so it could be latter retrained
# if need:
warn condition = ${if def:acl_m14}
add_header = $acl_m13
This enables exim to run dspam and add the result header to the message (both at data acl or at transport/router time) without having to run ugly transports which reinject the message again into exim.
Scans file for url's and test found urls against SURBL and URIBL. Has to be run in mime ACL. Requires libCURL.
Usage: ${dlfunc{/usr/local/exim/exim-ext.so}{surbl}{file}}
returns: surbl result
example::
warn set acl_m9 = 0
decode = default
warn condition = ${if eq{${lc:$mime_content_type}}\
{text/plain}}
set acl_m9 = ${dlfunc{/usr/local/exim/exim-ext.so}\
{surbl}{$mime_decoded_filename}}
warn condition = ${if eq{${lc:$mime_content_type}}\
{text/html}}
set acl_m9 = ${dlfunc{/usr/local/exim/exim-ext.so}\
{surbl}{$mime_decoded_filename}}
deny !condition = ${if eq {$acl_m9}{0}}
message = SPAM not welcome ($acl_m9)
log_message = DATA detected SPAM ($acl_m9)
Name Last modified Size Description
Parent Directory -
Makefile 10-Feb-2007 11:56 779 Makefile
geoip.c 10-Feb-2007 11:56 1.0K Smart ip country detection
geoip.o 26-Jul-2006 19:53 9.6K
getenv.c 10-Feb-2007 11:56 439 Get enviroment variables
getenv.o 26-Jul-2006 19:53 5.0K
mp-exim.o 26-Jul-2006 19:53 7.3K
pipe.c 10-Feb-2007 11:56 6.0K Pipe message or file to application and get stdout result
surbl.c 10-Feb-2007 11:56 5.6K Find url's in file and check against SURBL
surbl.o 26-Jul-2006 19:53 24K
By David Saez david (at) ols . es