Assuming You use dovecot 2.x and stores logs in /var/log/maillog:
cat /var/log/maillog | grep Login: | awk '{print $10}' | sed 's/rip=//g' | sed 's/,//g' >> /tmp/1.txt && sh -c 'for line in `cat /tmp/1.txt`; do geoiplookup $line; done' | sort | uniq | awk '{print $4 $5}'
gives You unique locations of every user login. You can also grep for specific login instead of all of them :)
If You are not rotating Your logs it will take some time to return results.

© odwiedź stronÄ™ http://maciejewski.org po wiÄ™cej fajnych postów!