On Wednesday 21 February 2007 14:26, [EMAIL PROTECTED] wrote: > On Wed, Feb 21, 2007, Jens Weibler <[EMAIL PROTECTED]> said: > > My wish would be: I can configure inside the plugins-config which > > plugins where used normally and which are used while relaying. > > i can see several ways to do this: > > 1. each plugin gets a 'skip_relayclients' boolean config option > 2. a special 'accept_relay' plugin gets loaded repeatedly, once per > hook, in just the right spot to break before certain plugins > 3. have just two plugins in control/plugins, check_relay and > 'uber_plugin' which will read control/relay_plugins and > control/nonrelay_plugins, and will rebuild the hook chains based on the > relay status. > > 2 is easiest, 1 and 3 more flexible.
I've had a meta-plugin in mind for some time which would take some sort of option to check a flag, such as relayclient() or perhaps another plugin's note, and then either run or not run a second, unmodified, plugin as a result. Not had time to do anything about it yet unfortunately, not even to design it. I can see a number of things to be careful of - for instance, if a flag is set in the middle of a transaction, then your second plugin may get hook_connect and hook_mail but not hook_rcpt and its developer, who may not even know about the meta-plugin, would have to take care not to introduce memory leaks. It could end up being very flexible, the chief RISK I foresee is it might be so cool that it developed into Yet Another Configuration Language :-) Nick
