> Now that I have three different AV packages installed, I want to find
> a way to run all three in a random fashion (rather than just one after
> another).  I can't think of a way to use the plugin wrapping API,
> since I want to have a single place where I check to see if the
> message is multi-part and skip all.  I also want to assign percentages
> to each scanner so that one might run more often than another.

The plugin wrapper isn't really meant for this kind of thing.  It
*could* work, but in the standard usage it would require intimate
knowledge of *all* of the plugins.

Actually, I think you could do it with the plugin wrapping API by
overriding Qpsmtpd::Plugin::register (or whatever its called) and
keeping track of all the hooks internally.  But that seems messy.

> I wonder if this wouldn't be best handled by making the config file
> YAML aware, so I could have something like this:

-1

I'm really not a fan of YAML as a configuration format.  It strikes me
as too fragile.

I much prefer the stricter, more limited, .ini style format.  Yes, it
isn't as flexible, but it's a lot harder to break.

> where 'antivirus_wrapper' is given the rest of the lines and winds up
> registering each of the other plugins to a custom event.  Then some
> sort of fancy math can happen where the three later plugins are
> randomly selected (sometimes more than one runs but never all three),
> and the exe_filter always runs (and if the message isn't multipart,
> they are all skipped).

A little too magical for me, and too invasive.

Using plugin wrappers, you'd need a wrapper for each plugin, and one
more plugin (that runs early on) to pick the random numbers which each
wrapper uses to decide whether to run its associated functions.

-R

Reply via email to