You are not logged in. Log in now?
Show a Story
Slapdash Analysis of Postfix Mail Log
Here's a quick one-liner to generate statistics about how often hosts from certain countries tried to deposit mail without having proper (reverse) DNS entries:
sed -n -e 's/.*NOQUEUE:.*from unknown\[\([0-9.]\+\)\].*/\1/p' mail.*| \
xargs -l geoiplookup| \
awk -F, '{print $2.trim}'| \
sort | uniq -c | sort -rnk1
The output looks something like this snippet, based on logs from July 21 to August 5 on my mail server:
| Freq. | Country |
|---|---|
| 1374 | India |
| 1089 | Vietnam |
| 842 | Brazil |
| 733 | United States |
| 650 | Korea |
| 644 | China |
| 621 | Russian Federation |
| 537 | Indonesia |
| 374 | Romania |
| 333 | Colombia |
Germany comes in 33rd.
By Shadowdancer, 2010-08-05, 16:55;
permalink;
Last updated at 2010-08-05, 16:58 by Shadowdancer