Charlie Brady wrote:
There I propose a method for dynamically modifying the qpsmtpd configuration during the connect hook, so that the full configuration depends on the connecting source IP address.

Yes, but, this still has nothing to do with the _transaction_ object in hook_connect(), which does nothing now, and with your proposed patch still does nothing. You want to diddle with the _connection_ object based on criteria available during the initial connect. At that point, there is no transaction (since it doesn't get initialized until the banner is sent and HELO/EHLO is received).

Ask also said this:

   It should be possible to modify the list of plugins on the fly (without
   having to reload them all the time).

At the present time it's not possible - correct?

It's possible now (by crawling through the connection object's array of plugins), but it isn't obvious or easy (in fact it would take some work yet to make it merely difficult instead of nearly impossible).

Because of the way that the plugins are compiled into the Qp object on the fly during loading, they are opaque, and hence are not terribly easy to do anything with. I think that the most appropriate way to go is to write a custom hook_config plugin which compiles, but does not load, all available plugins (e.g. the contents of the existing config/plugins). Then a matching hook_connect plugin would stuff those plugins into the current connection object, based on whatever criteria was given.

The rub is that certain hooks require at least one plugin for correct operation (e.g. you must have a RCPT plugin to return OK at some point, or the transaction won't proceed past that phase).

Does that make any sense to anyone other than myself?

John

Reply via email to