[Exim] Python local_scan function

Top Pagina
Delete this message
Reply to this message
Auteur: Barry Pederson
Datum:  
Aan: exim-users
Onderwerp: [Exim] Python local_scan function
I've put together an Exim 4.x local_scan() function that uses an embedded
Python interpreter to execute your scan functions. A simple "hello world"
type scan function in Python might look like:

     import exim


     def local_scan():
         exim.log("hello from python")
         return exim.LOCAL_SCAN_ACCEPT


This would add an entry to the Exim mainlog for each incoming message.

A Python scan function has access to the same variables a C local_scan
function has, can add headers, change the recipient list, and call back to
Exim for do string expansions. A big advantage to using a Python script is
that you can alter your scan function without having to recompile or even
restart Exim.

Get the software from:

     http://barryp.org/software/py-exim-localscan


It includes general build instructions, and some extra notes specifically
for FreeBSD. I believe it should work on other platforms, but FreeBSD 4.6,
Exim 4.10, and Python 2.2.1 are what is known to work at the moment.

    Barry