When you know that there is spamming from a particular domain or account. But when you copy the message ID from the mail queue and try to view the body and header the message is no longer in queue. Following script can be used in such conditions when the mails are not staying in queue for long period of time:
read -p "Enter the domain name or username: " name; while true; do i=`exim -bp | grep $name | awk '{print $3}' | sed '/^$/d' | tail -n1`; if [ ! -z "$i" ]; then echo -e "\nBody"; echo -e "++++++++++++++++++++++++\n"; echo -e "Message ID: $i\n----------------------------\n"; exim -Mvb $i;echo -e "\nHeader"; echo -e "++++++++++++++++++++++++\n"; echo -e "Message ID: $i\n----------------------------\n"; exim -Mvh $i; echo -e "\n=================================================================================================="; fi done
This will display the most recent mail of the specified domain/account that is in mail queue. This script will wait for new mails and display the mail when it appears in queue.
Try it