One line to know where your users are on vacation :) (if they use company mail on vacation)

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.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)
Related Posts with Thumbnails

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

Podobne posty

Dodaj komentarz

Twój adres email nie zostanie opublikowany.

Time limit is exhausted. Please reload the CAPTCHA.

CommentLuv badge