#!/bin/bash
# Afrihost - show logs of original messages related to current bounces in the queue


exim -bp | grep "<>" | /usr/local/afribin/exim_msgid_grep | sort | uniq |
 xargs -i echo "grep {} /var/log/exim_mainlog| head -n1 " | bash  | awk  '{print $7}'| grep ^R | sed 's/R=//' |
/usr/local/afribin/exim_msgid_grep | sort | uniq   | grep ^1 | while read pmail ; do
 echo -e  "\n======= $pmail ======\n $(zgrep $pmail /var/log/exim_mainlog) \n======= $pmail end ======\n"
done  | geoip

