On 1 Dec 99, at 16:38, Jon Rust wrote:
> At 1:30 AM +0100 12/2/99, [EMAIL PROTECTED] wrote:
> >The IPs are written to the spool dir and relay-ctrl-age creates a new
> >cdb file every 5 minutes via cron. It's strange. Are there other
> >relay solutions which works?
>
> Hmmm... are you using the same cdb files for your qmail-smtpd
> invocation that you're specifying here? If you run a cdbdump, what
> does it show?
>
> cdbdump </etc/tcp.smtp.cdb | tr '\0' :
>
> You should get a whole list of IPs like so:
>
> +15,14:192.168.100.1->+RELAYCLIENT=:
> +14,14:10.3.4.5->+RELAYCLIENT=:
>
> Are the test IPs in there?
>
> jon
Or, you could try this:
#!/bin/bash
echo ""
relayclients=`cdbtest < /etc/tcp.smtp.cdb \
| awk 'BEGIN { FS = ": " }{ if (number < $2) number = $2 }
END { number-- ; print number }'`
ipaddresses=`cdbdump < /etc/tcp.smtp.cdb | awk 'BEGIN { FS = "->" }{
print $1 }' \
| awk 'BEGIN { FS = ":" }{ print $2 }' | sort | tail --lines
$relayclients`
echo "- current number of relay clients: $relayclients"
echo "- and their corresponding IP addresses:"
echo "$ipaddresses"
(but i'd appreciate a small c gadget for this, anyone ?)
--
Webhosting: http://www.kvikkjokk.com
Oden Eriksson (CNE+MCSE+Linux)
UIN: 952113
0971-554 52, 070-346 43 02