Re: [EXIM] Perl enabled exim

Top Page
Delete this message
Reply to this message
Author: Martin Hamilton
Date:  
To: exim-users
Subject: Re: [EXIM] Perl enabled exim
Nigel Metheringham writes:

| In theory embedding a perl is quite easy. In practice life will be more
| complicated. perl will need access to exim state - basically the
| expansion variables and the message. It will need to be able to modify
| some things - my initial thinking is that it needs to be able to do the
| same as the system filter PLUS the ability to direct messages to a
| specific transport (once you can do that you can for example direct all
| spam to a BSMTP mailbox which allows you to recover your mistakes).


There's another approach which, whilst apparently even more radical
(or stupid, depending on your point of view :-) has a certain appeal :-

Write a Perl based mail hub!

As I said, this might sound like a stupid idea, but consider...

* (fairly) portable language
* avoids buffer overrun scenarios
* does own memory management
* concise (though this could be a flaw!)
* already systems hacking language of choice ?
* easy interface to [SGN]DB(M) databases
* easy interface to TCP/IP networking
* designed to process strings, regexps, ...
* interfaces well with other programs

After hacking around in the guts of Exim and sendmail for a while, I'm
starting to think that this is really the only sensible way forward
for Unix based mail systems. What was in that coffee ? :-)

The main problems would seem to be in the areas of process forking
(multiplex across a pool of socket descriptors instead?) and
permissions (we don't want Perl programs running as root). I'm
thinking that a hypothetical Perl mail hub would be started by a
wrapper program which immediately surrendered its privileges, and
perhaps not even try to do its own local deliveries. There's no reason
why the Internet mail gateway for (say) a whole organisation has to be
the same program which actually delivers the messages into people's
mailboxes.

It would be useful if this hypothetical Perl based mail hub could
process Exim config files (at least up to a point), read/write the
Exim state databases, and use the same queue structure.

Obviously this is just a very rough sketch so far. If anyone's
interested in hacking some code, we could set up a mailing list...
I'll probably have a go at writing it myself at some point in the
future if nobody's beaten me to it, but don't hold your breath!

Ciao!

Martin





--
*** Exim information can be found at http://www.exim.org/ ***