I need to queue messages to different backends depending on various characteristics of the incoming message, probably the contents of the recipient field. I'm trying to put a dspam appliance into our system, and I'd like to do it for a single domain to start with. I know I could write a variant of smtp-forward which would return declined for all domains except the one I am interested in. But I thought I would try to do this in a more general fashion in the hopes someone else may find it useful.

Before I start on this, I thought I'd document how I think this might work, so ya'll can shoot holes in it before I waste too much time. ;-)

The file config/conditional_queue would look like this:

regex<TAB>priority<TAB>queue<TAB>queue-options

where the columns are defined as:

regex - a standard Perl regex (compiled using qr//) that is compared against each recipient in turn; if all recipients match in the first pass, the message is queued once and the backend is free to serialize later. Otherwise, each recipient is treated independently and the message will be serialized at this point (or something in between).

priority - multiple queues could be used for a single regex (to have a fallback processing option), ordered by priority (which should be monotonically increasing).

queue - the queue plugin to employ for all recipients matching this regex

queue-options - the same options available on the config/plugins line; they are also used as keys to cache the configurations for later reuse.

I'm thinking of using something like the code in isa_plugin() to create pre-compiled plugins which can then be dispatched from a common hook_queue() call in the conditional_queue plugin.

Thoughts?  Bricks?  Rotten fruit?

John

p.s. I'm back!

Reply via email to