A few weeks ago, I posted a request here concerning Julian Mehnle's
excellent Courier::Filter module. I haven't seen a reply, and so I'm
reposting my query. If for some reason I missed the response(s) to my
original message, I apologize.
In processing a chain of filters within the Courier::Filter framework,
I have found that there are cases in which I'd like to manage global
state among filters. In other words, it would be nice if I can make
some of the results of one filter available to other filters.
One example of this concerns the use of an SPF filter. I'd like
subsequent filter steps to perform their filtering with the knowledge of
the result of the SPF step: "unknown", "neutral", etc.
Currently, there is no mechanism that I have been able to find within
Courier::Filter to pass such state information from filter step to
filter step.
I know that I can hack this as follows, but I'm wondering if there's a
better way. If not, I'd like to request that a subsequent
Courier::Filter version have some sort of built-in global state
management facility.
Here's my hack:
Within the `pureperfilter.conf' file ...
# ... etc. ...
my %datamap = ();
# ... etc. ...
$options = {
# ... etc. ...
modules => [
Courier::Filter::Module::Foo->new(
# ... etc. ...
datamap => \%datamap,
),
Courier::Filter::Module::Bar->new(
# ... etc. ...
datamap => \%datamap,
),
Courier::Filter::Module::Quack->new(
# ... etc. ...
datamap => \%datamap,
),
];
};
With this, I can get, set, and clear values from within %datamap by
means of the following code within each filter module ...
sub match {
my ($module, $message) = @_;
my $class = ref($module);
# Access this global data via the $module{datamap} hash
# reference.
# ... etc. ...
}
But this feels kind of "hackish" to me, and I'm hoping that we could
have a more elegant way of doing this.
Any thoughts or suggestions?
Thanks in advance.
--
Lloyd Zusman
[EMAIL PROTECTED]
God bless you.
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users