added the base exim scanner
This commit is contained in:
parent
cfc77fc119
commit
f7a9f48406
1
email-tools/eximlogger/localdomains
Normal file
1
email-tools/eximlogger/localdomains
Normal file
@ -0,0 +1 @@
|
||||
benjamyn.love
|
||||
37
email-tools/eximlogger/statsbyaddress.sh
Executable file
37
email-tools/eximlogger/statsbyaddress.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
# Hopefully I can get this to work, it should be able to helps with troubleshooting email issues
|
||||
|
||||
MAILLOGFILE="/var/log/exim/main.log"
|
||||
LOCALDOMAINFILE="localdomains"
|
||||
EMAILADDR=$1
|
||||
SEARCHTERM=$EMAILADDR
|
||||
LOCAL=false
|
||||
|
||||
isDomainLocal() {
|
||||
grep $1 $LOCALDOMAINFILE > /dev/null
|
||||
if [[ $? == 0 ]]
|
||||
then
|
||||
TMPVAL=`echo $EMAILADDR | cut -d '@' -f 1`
|
||||
SEARCHTERM=$TMPVAL
|
||||
echo "$TMPVAL"
|
||||
fi
|
||||
}
|
||||
|
||||
DOMAIN=`echo $EMAILADDR | cut -d '@' -f 2`
|
||||
isDomainLocal $DOMAIN
|
||||
echo "$SEARCHTERM"
|
||||
|
||||
echo "---------Email Throughput for $1--------"
|
||||
echo "Emails Sent by: `exigrep $SEARCHTERM $MAILLOGFILE | grep "<= $SEARCHTERM" | wc -l`"
|
||||
echo "Emails Sent to: `exigrep $SEARCHTERM $MAILLOGFILE | grep "=> $SEARCHTERM" | wc -l`"
|
||||
echo "Total emails with $1: `exigrep $SEARCHTERM $MAILLOGFILE | grep -i 'completed' | wc -l`"
|
||||
|
||||
echo ""
|
||||
echo "--------Email ID's for sent/received--------"
|
||||
echo "Sent By ID's:"
|
||||
echo "`exigrep $SEARCHTERM $MAILLOGFILE | grep "<= $SEARCHTERM" | awk '{print $3 " From " $6 ":" $7}' `"
|
||||
echo "Sent To ID's:"
|
||||
echo "`exigrep $SEARCHTERM $MAILLOGFILE | grep "=> $SEARCHTERM" | awk '{print $3" To " $8 ":" $9}' `"
|
||||
|
||||
echo ""
|
||||
echo "-------Emails Send from Hosts-------"
|
||||
Loading…
x
Reference in New Issue
Block a user