|Subject:||[courier-users] Re: Courier/SqWebMail build 20040411|
|From:||Lloyd Zusman (lj...@asfast.com)|
|Date:||Apr 12, 2004 9:01:04 pm|
Sam Varshavchik <mrs...@courier-mta.com> writes:
[ ... ]
â¢ Record internal queue ID in Received: headers.
Thank you for applying this queue-ID patch!
Now, we finally have the ability for a global filter step to cause a message to be modified.
For those of you who missed the earlier discussion, here's how this can work:
- A global filter step determines that a particular message needs to be modified.
- Within this filter step, get this Queue ID from the initial Received: header of the message.
- Use this Queue ID (which is guaranteed to be unique) as a key to a data store. Using this key, save in the data store an indication of the modifications that need to be done on the message.
- Accept the message in this global filter step.
- In a later local filter step, preferably the earliest local filter step that takes place, once again get this Queue ID from the initial Received: header of the message.
- Use that Queue ID as a key to look up information in the data store.
- If no information is found, proceed with any other local filtering that is necessary. However, if information is indeed found, interpret that information as instructions for modifying the message, and then do so before continuing with the local filter processing.
In order to do this, some client software needs to be written. I am in the process of writing the some code that does this from within a Perl Courier::Filter module. Once I have a working prototype of this, I'll post it here.
This code will have two parts:
1. The part which is called from within a global filter, to store message-modification instructions in the data store.
2. The part which is invoked from within a local filter. This will be a stand-alone program that serves as an 'xfilter'. It looks up modification instructions in the data store and then performs them appropriately.
Yes, I know that this is a bit complicated. But it would take a major re-write of certain parts of Courier in order for a global filter step to directly modify a message. On the other hand, the only rewrite necessary to enable this functionality is the addition of the Queue ID in the Received: header, which is a very small amount of code that requires no structural or logic changes to the Courier system.
If you don't like this approach, you can always have the global filter drop the message and reinject a modified version of it. I personally think that this is less efficient, but this is only a guess. Once I write my prototype, we can then run benchmarks on the two methods to see which one takes up the fewest resources.
-- Lloyd Zusman lj...@asfast.com