John L wrote:
Does anyone have a plugin to interpret the CDB files that tcpserver
uses? I'm working in a mixed environment of qmail-smtpd and qpsmtpd and
it would be nice not to have to maintain two sets of rule files in
parallel.
It's not hard to write, but I'd just as soon not duplicate work if I
don't have to.
I don't have anything, but the keys are just IP address, or part of the
IP, so you can do:
sub get_value {
my ($cdb, $ip) = @_;
do {
if (exists($cdb->{$ip})) {
return $cdb->{$ip};
}
} while ($ip =~ s/\d+\.?$//);
}
Matt.