Difference between revisions of "Mail Bandwidth Usage Per Email Account"
From James Dooley's Wiki
(Created page with "==Overview== This script is set up to copy the current php.ini file to a users directory and block web users from being able to view it in .htaccess. There are two versions of t...") |
|||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| + | [[Category:One Liners]] | ||
==Overview== | ==Overview== | ||
This script is set up to copy the current php.ini file to a users directory and block web users from being able to view it in .htaccess. | This script is set up to copy the current php.ini file to a users directory and block web users from being able to view it in .htaccess. | ||
| Line 6: | Line 7: | ||
==Script== | ==Script== | ||
| − | < | + | <source lang='bash'> |
| − | for address in $(grep ${DOMAIN} maillog | grep pop3d| awk '{print $7}' | cut -d "=" -f2 | sed 's/,//' | sort | uniq); do grep $address maillog* | grep | + | for address in $(grep ${DOMAIN} maillog | grep pop3d| awk '{print $7}' | cut -d "=" -f2 | sed 's/,//' | sort | uniq); |
| − | </ | + | do grep $address maillog* | grep `date +%b` | grep pop3d | grep LOGOUT | awk '{print $13}' | cut -d "=" -f2 | sed 's/,//' | awk '{total=total+$1}END{print total}' | xargs echo "$address: ";done | sort -k 2 -nr |
| + | </source> | ||
==What to change== | ==What to change== | ||
Latest revision as of 14:28, 25 March 2014
Overview
This script is set up to copy the current php.ini file to a users directory and block web users from being able to view it in .htaccess.
There are two versions of this script, one for SuPHP one without.
Script
for address in $(grep ${DOMAIN} maillog | grep pop3d| awk '{print $7}' | cut -d "=" -f2 | sed 's/,//' | sort | uniq);
do grep $address maillog* | grep `date +%b` | grep pop3d | grep LOGOUT | awk '{print $13}' | cut -d "=" -f2 | sed 's/,//' | awk '{total=total+$1}END{print total}' | xargs echo "$address: ";done | sort -k 2 -nr
What to change
${DOMAIN} will need to be changed for the domain name you want to search for
pop3d can be changed to look at imap instead.