Re: [Exim] TURN support

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Philip Hazel
Date:  
À: Arne Georg Gleditsch
CC: exim-users
Sujet: Re: [Exim] TURN support
On Mon, 11 Aug 2003, Arne Georg Gleditsch wrote:

> My patch supports TURN in a satisfactory manner for me. Even so I
> would like to base my deployed solutions on something I know will be
> maintained upstream. The hassle of doing so myself, by keeping an
> add-on patch in step with upstream code, is not tempting.


I entirely understand!

> So, let me
> try a different angle. If I had:
>
>  * A transport (option to appendfile) that enabled delivering to
>    directories containing files on the standard Exim-queue format.


There already exists the option for delivering in BSMTP format, which is
effectively a copy of what you would send down an SMTP connection.

>  * A command-line option to runq to tell it to use stdin/stdout for
>    delivering messages.


Inspiration strikes!

The existing -MC option, which is normally only used internally by
Exim, does more or less this. However, it needs to be told exactly which
message to deliver. But "deliver a message to stdout/stdin" is *exactly*
what you want, isn't it?

>  * Acl-s for turn/atrn and an option for specifying an external
>    command to run upon accepting TURN/ATRN from a client.


Adding an ACL is easy enough, and yes, that feature isn't controversial.

I had forgotten about the -MC option when I was thinking about this
earlier. Which is embarrassing, because the more I think about it, the
more it looks as if it could be "turned" to this purpose. Sorry about
that. Keeping all of Exim in my head is getting harder - and I'm not
getting younger...

Given the ACL and the ability to run an arbitrary command, you might be
able to do something like this:

(1) Either leave the messages on Exim's normal queue (if there are not
too many of them), or arrange for them to be sent to a different
instance of Exim, with a different spool directory. (That achieves your
first object without modifying the code.)

(2) Write a script that is run by TURN. The script can use -bp to scan
the waiting messages and find one that is waiting for the connected host
or domain.

(3) The script then runs 'exim -MC <options>' for one waiting message.
Exim should automatically pass the stdin/stdout to further processes to
deliver any other messages that are waiting for the same host.

If this works, the only code changes needed are the addition of the ACL
and the command to be run.

The -MC option is not well documented, because it was never intended for
external use. If what I have suggest does work, I will extend the
documentation.

Philip

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book