/opt/dedrads
NameSizeModeActions
account_review/-0555rm
check_software_mods/-0555rm
cms_tools/-0555rm
etc/-0555rm
extras/-0555rm
mailparse/-0555rm
mysql/-0555rm
nlp_scripts/-0555rm
oldrads/-0555rm
perl/-0555rm
provision/-0555rm
python/-0555rm
suspended/-0555rm
__pycache__/-0555rm
account-review7990555editdlrm
allfw62590555editdlrm
alp.py165530555editdlrm
autossl_sync62670555editdlrm
check_apache92050555editdlrm
check_bandwidth45460555editdlrm
check_boxtrapper16840555editdlrm
check_cpu122120555editdlrm
check_crons18270555editdlrm
check_dcpumon19730555editdlrm
check_dns18270555editdlrm
check_domlogs610555editdlrm
check_exim37310555editdlrm
check_hacks226040555editdlrm
check_imap52490555editdlrm
check_io66350555editdlrm
check_max_children163410555editdlrm
check_mem16600555editdlrm
check_misc15100555editdlrm
check_pacct52010555editdlrm
check_php43440555editdlrm
check_pop322950555editdlrm
check_prov.py47140555editdlrm
check_server6960555editdlrm
check_size4900555editdlrm
check_software98490555editdlrm
check_spamd24260555editdlrm
check_traffic19330555editdlrm
check_user18870555editdlrm
clean_exim.py63900555editdlrm
clusterfix53430555editdlrm
cmspass.py39700555editdlrm
cms_check.py98250555editdlrm
cms_counter.py367340555editdlrm
cms_creds7130555editdlrm
cms_dumpdb44850555editdlrm
cms_pw14160555editdlrm
cpanel-api70400555editdlrm
cpanel_postgres_manager.py290040555editdlrm
cpmerge46310555editdlrm
cpumon21950555editdlrm
dcpumon.pl12390555editdlrm
dedcheck181270555editdlrm
dns-sync143860555editdlrm
docroot.py44250555editdlrm
du-tree74500555editdlrm
envinfo.py66330555editdlrm
exclude_rbl.py52490555editdlrm
extract-vhost26910555editdlrm
filescan35660555editdlrm
find_warez14600555editdlrm
first_setup.py191200555editdlrm
fixwpcron.py48220555editdlrm
fix_dns_cluster3530555editdlrm
goaccess12177200555editdlrm
hostsfilemods44670555editdlrm
imap_io23230555editdlrm
innodb_converter.py93430555editdlrm
killall9115300555editdlrm
killdns9410555editdlrm
lastcommcache.sh13740555editdlrm
legal_lock_down.sh74500555editdlrm
lil-cpanel520020555editdlrm
listacct45750555editdlrm
mailscan45440555editdlrm
mail_sources.py74070555editdlrm
megaclisas-status386640555editdlrm
migrate2central.sh144180555editdlrm
modify-account406310555editdlrm
modsec_disable.py114610555editdlrm
monarxctl89120555editdlrm
msp.pl277140555editdlrm
mysql_dstat4740555editdlrm
mysql_selector.py731020555editdlrm
nlp45820555editdlrm
procscrape18630555editdlrm
quarantine110830555editdlrm
radsfunctions.sh8630555editdlrm
recent-cp161480555editdlrm
remote_dump183470555editdlrm
reset_cpanel32050555editdlrm
server-load21920555editdlrm
show-conns201050555editdlrm
show-conns-adv.py546670555editdlrm
sparta.py3824980555editdlrm
sqltop271290555editdlrm
telcheck24110555editdlrm
temprootreset1860555editdlrm
unsuspend_user13070555editdlrm
unsusprunner.sh18400555editdlrm
updatednsadmin5260555editdlrm
update_spf149720555editdlrm
upgrade-check92160555editdlrm
vhost_data.py62210555editdlrm
wp-xray.sh858160555editdlrm
Edit: /opt/dedrads/mailscan (4544B)
#!/bin/bash ###################################################################################################### # Script: mailscan # Author: Jason N # Version: 1.0.2 # Contact: jasonn@inmotionhosting.com # Purpose: Scans all account mail inboxes, sent boxes, and recent login usage and reports account size, message counts, and logins per protocol ###################################################################################################### # Version 1.0.2 - minor bugfix / removal of extra code # variables userpath=/var/cpanel/users username=$1 maildomains= logcount=300000 inbox_limit=0 #functions function usagetxt { if [[ $errortxt != "" && "$helptxt" != "1" ]] ; then echo -e "\nERROR: $errortxt"; fi echo -e "\nUsage: mailscan "; if [[ "$helptxt" -eq "1" ]] ; then echo -e "\n\tAvailable options:"; echo -e "\t\t-s / --summary\t\t: Only output account, size, and inbox count fields"; # echo -e "\t\t-c / --current\t\t: Get mail account list from current process list - in development"; # echo -e "\t\t-ac / --all-current\t: Get all current mail connections to the system - in development"; echo -e "\t\t-lc= / --log-count=\t: Change the default line history mailscan will use when reviewing /var/log/maillog (default is $logcount)"; echo -e "\t\t-il= / --inbox-limit=\t: Change the default inbox message count that will be displayed (default is $inbox_limit)\n"; else echo -e "\n\tHelp available with option -h or --help"; fi exit; } #parse command options for i in "$@" ; do case $i in -s | --summary) summary="1" ;; -ac | --all-current) all_current="1" ;; -c | --current) current_conns="1" ;; -lc* | --log-count*) logcount=`echo $i | awk -F'=' '{gsub(/ /,"",$2); print $2}'` ;; -il* | --inbox-limit*) inbox_limit=`echo $i | awk -F'=' '{gsub(/ /,"",$2); print $2}'` ;; -h | --help) errortxt="Help page."; helptxt="1" ; usagetxt ;; esac done # get list of local home directories from system homedirs=`ls / | sed -e 's/\///g' | egrep "^home$|^home[0-9]$"` if [[ "$#" -eq "0" ]] ; then errortxt="No user provided"; usagetxt exit fi #parse_options if [[ "$all_current" -eq "1" ]] ; then echo "Under Development"; exit elif [[ -e $userpath/$username ]] then echo "User $username found, scanning" else errortxt="User $username does not exist on this system"; usagetxt exit fi # find users home directory and verify it exists for tmphomedir in $homedirs ; do if [[ -e /$tmphomedir/$username ]] ; then homedir=$tmphomedir fi done # get the list of mail domains on the account from etc in their home directory maildomains=`ls /$homedir/$username/etc| egrep -v "\.\/|\.\.\/|\.boxtrapper|ftpquota|rcube.db|passwd\,v|quota\,v|shadow\,v|\.imapv4"` #loop through list of mail domains and get email account details for currentdomain in $maildomains ; do scandomain=/$homedir/$username/mail/$currentdomain ; # path to domain to scan if [[ -e "$scandomain" ]] ; then cd $scandomain ; workingdomain=`pwd|awk -F'/' '{print $5}'`; # loop through the list of users in the domains mail directory for i in $(ls| egrep -v "\.\/|\.\.\/"| awk -F'/' '{print $1}') ; do address="$i@$workingdomain"; # email address if [[ ! -e $i/cur ]] ; then continue; fi dsize=`du -sh $i/cur | awk '{print $1}'` ; # size of mail inbox inboxcount=`ls $i/cur | wc -l`; # number of messages in inbox if [[ -e $i/.Sent/cur ]] ; then sentcount=`ls $i/.Sent/cur | wc -l`; # number of sent messages else sentcount=0; fi # get number of recent imap logins imapcount=`tail -n$logcount /var/log/maillog | grep $address | egrep "imapd:|imapd-ssl:" | grep LOGIN | wc -l`; # get number of recent pop logins popcount=`tail -n$logcount /var/log/maillog | grep $address | egrep "pop3d:|pop3d-ssl:" | grep LOGIN | wc -l`; # output the results if [[ "$summary" -eq "1" ]] ; then echo $address","$dsize","$inboxcount","$inbox_limit | awk -F',' '$3 >= $4 {printf "%40s\t Inbox Size: %6s\tInbox Count: %6s\n",$1, $2, $3}'; else echo $address","$dsize","$inboxcount","$sentcount","$imapcount","$popcount","$inbox_limit | awk -F',' '$3 >= $7 {printf "%40s\t Inbox Size: %6s\tInbox: %6s\tSent:%6s\tIMAP: %4s\tPOP: %4s\n",$1, $2, $3, $4, $5, $6}'; fi done; fi done;