How would you? - Complex conditional mail re-direction

Hello folks, hoping I can pick the brains of the Stans, Bens et al who grace this forum with their cerebral might :o)

I need to set-up Subject-line specific mail re-direction for a single (externally facing) address (customer.services@company.com), which currently delivers to a single mail-in database: If the Subject line to our customer services address contains the start of a postal (ZIP) code (by use of a prefix (e.g. “ POSTCODE=XYZ”)), the mail needs to be sent on to one of a few dozen different mail-in databases (one per ‘Depot’ for a geographic area).

I had initially thought we’d simply set-up some Rules in the customer services mail file, one for each geographic area (requiring <40 Rules - safely under the 99 limit) and have a few conditions in each Rule to match on the various postal code prefixes required to identify the area (we were told that there would be a maximum of about 5 postal code prefixes per area). But! I have now found out that a few geographic areas cross with others and to get the mail directed to the correct Depot requires very granular matching of postal codes, which would result in around 200 conditions for some Rules :frowning:

From searching the forums, I get the strong impression that using Rules with so many conditions is asking for trouble, so was about to go and write an Agent with a bunch of @If( @Contains… conditions to do the mail re-direction - This is no problem for me to code, but before I do, was wondering if anyone has any alternative suggestions (or have experience with Rules that work with hundreds of conditions in one Rule)?

Let me know if you have already invented this wheel :o)

Thanks,

James.

Subject: How would you? - Complex conditional mail re-direction

James,

I would create a LS agent to do this:

  1. After new mail arrives

  2. Punch in a field such as NewMailAgent and give it the value of NOW. This will give you a bit of an audit trail and prevent duplicate processing (have your agent verify that this field does not exist on docs before processing them).

  3. Create a form/view where the owners can maintain the postal code and location, so you don’t have to. So the form could have just a postal code field and then a path to the correct db. Now your code just has to lookup to this view and determine where each piece of mail should go. With 200+ locations, there are bound to be changes every month, and the last thing you want to do is bop into your agent every few weeks to make tiny changes … and hope that you haven’t broken the code.

just my 2c,

raphael