Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Check body and header of mail when the mail does not stay longer in queue  (Read 1608 times)

0 Members and 1 Guest are viewing this topic.

Dan George

  • Guest
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:

Quote
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 ;)