Category Archives: Postfix

Maillog Enhanced Queries

POSTFIX

E-Mails TO specific address ignoring amavis delivered queue “relay=127.0.0.1”

cat postfix| grep -v Greylisting | grep -i "to=<foo@foo>" | grep -Ev 'relay=dfilt|relay=127.0.0.1' | awk '{print $6}' | grep -v NOQUEUE | sort | uniq | while read L; do echo -e "\n------$L------\n" && grep $L postfix; done > output.txt; COUNT=`cat postfix| grep -v Greylisting | grep -i "to=<foo@foo>" | grep -Ev 'relay=dfilt|relay=127.0.0.1' | awk '{print $6}' | grep -v NOQUEUE | sort | uniq | wc -l` && echo -e "\n\nTOTAL CORREOS = $COUNT\n" >> output.txt

E-Mails FROM specific address ignoring amavis delivered queue “relay=127.0.0.1”

cat postfix| grep -i "from=<foo@foo>" | awk '{print $6}' | grep -v NOQUEUE | sort | uniq > temp.queues ; cat temp.queues | while read L; do grep $L postfix| grep -E 'relay=127.0.0.1|relay=dfilt' | awk '{print $6}' ; done > temp.queues.2 ; diff temp.queues temp.queues.2 | grep "<" | awk '{print $2}' | while read Z; do echo -e "\n-----$Z-----\n" && grep $Z postfix; done > output.txt; COUNT=`diff temp.queues temp.queues.2 | grep "<" | wc -l` && echo -e "\n\nTOTAL CORREOS = $COUNT\n" >> output.txt; rm temp.queues* -rf
Advertisements