Hi,
I want to make a “semi” dynamic rule that would tag emails that matches a list
of strings, something like this:
sub filter {
my($entity, $fname, $ext, $type) = @_;
return if message_rejected();
if ($Sender =~ XYZ {
if ($Subject =~ [input from a list] ) {
action_change_header('Subject', “[ADD CUSTOM TAG]$Subject");
} else {
my $io;
if ($io = $entity->open("r")) {
while (defined($_ = $io->getline)) {
if ( [input from a list] ) {
action_change_header('Subject', “[ADD CUSTOM
TAG]$Subject");
last;
}
}
$io->close;
}
}
}
return action_accept();
}
I wonder what the best solution would be to achieve this?
Currently, the [input from a list] is a text file which holds a lot of strings,
one per line, and is currently about 6000+ lines long...
Is it a bad idea to open and read the text file from mimedefang-filter?
Would it be better to generate a new version of mimedefang-filter with the
content of the text file inline?
Or should I consider something else?
The text file is also updated, but not that frequently…
/P
_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID. You may ignore it.
Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang