Fun

    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.

    Related Posts with Thumbnails

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

    Add your widget here