cPanel – Worst tips and tricks in the universe

Published on Author gryzli

These are some little commands, which are very handy in a day to day cPanel struggles…

 

1. Sorted list of all IP’s generating SMTP Connections to EXIM  for the day

# Frist, lets speed up our grep
unset LANG

# Now do the job
# 2014-11-21 is the date for which you need records
grep "2014-11-21" /var/log/exim_mainlog | grep "SMTP connection from"  | sed -re "s/.*\[(.*[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/g" | sort -n  | uniq -c | sort -n