Greetings
I have managed to call TMDA directly from an Exim filter and want to
share the procedure. There is an item on the Exim wishlist (nr. 199)
that will make this much easier, but the solution I have now works quite
nice too. Many thanks to Nico for the initial idea.
Following happens. There is a daemon that runs as a user that has
permsission to access the Exim spool directory. This daemon sets up a Unix
socket (in my case ~/tmp/tmda.sock) and awaits connections.
Exim has an expansion operator that allows communication over a Unix
socket. Just before the delivery to Inbox, I placed following bit of
filter instructions:
if $sender_address is not "" and
$message_size is below 200k then
if "${readsocket{$home/tmp/tmda.sock}{$message_id\n\
$return_path\n\
$local_part\n\
${substr_1:$local_part_suffix}\n\
$domain\n}{20s}{}}" is 1 then
seen finish
endif
endif
The background process gets the message id and tries to construct a
message from -H and -D files in the Exim spool directory[1]. Currently
there is no way to run a program and pass the message on its stdin
("pipe" delivery command doesn't count as it's not possible to check the
program's exit code and ${run} has no way to access the contents of the
message).
The daemon itself is available at <http://km.krot.org/code/tmda.pl>. It
should be started when the system boots up.
Regards
Kirill
[1] Note: I have split_spool_directory unset, you will need to change
the code of the daemon a little bit if you have split_spool_directory
set.
--
Er en viljeserkl�ring forvansket ved feiltelegrafering, blir den, som har
avgit den, ikke bundet ved erkl�ringen i den skikkelse, den er kommet frem.
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users