[Exim] [RFC] a general iplookup

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Nico Erfurth
Date:  
À: exim-users
Sujet: [Exim] [RFC] a general iplookup
Hi,

last days i thought more and more about a more generic iplookup. For now
the iplookup-router just knows how to send a string (in fact the current
email-address) to a port and waits for a new address to come back from
it, what i'm thinking about is to make it more general, in fact a
iplookup-lookup, like this

${lookup {$domain} ip {localhost:port:tcp}}
or
${lookup {somethingelse} ip {localhost:port:tcp}}

this could be done with an simple protocol like this
(>> indicates outgoing and << incoming)

---exim opens socket
>>user@???

<<forward@???
<<moreforwards@???
<<|pipecommand
<</some/mailbox
---sender closes socket

So the input is delimited with a LF, and the output by the the end of
the connection.
Or something more complex like this

---exim opens socket (or uses a cached one)
>>30 <---- this is the size of the data that follow
>>sometext
>>that goes over multiple lines
>>and should be as long as the first line indicates

<<100 <----- responsesize
<<100 chars of response
--- socket will NOT be closed

So we even could cache the connections.
With a special modifier we could even swith between the two cases, like
${lookup {$domain} ip {localhost:port:tcp}} for the first case and
${lookup {$domain} ip {localhost:port:tcp:extended}} for the second
case.


How could this be used:
  -Complex databases that are not supported in exim
  -Implementing caches that will work for more than the current exim
    process
  -Doing totaly strange things ;)


I know, this all could be done with embedded perl or even a external
command, but these both have much overhead (loading the perl interpreter
into exim, ore forking a new process).

Anyone interested in something like this?

Comments to the list, flames to me ;)

ciao