Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to monitor my email service installed on Server A, from end to end. Not just small pieces (ping / SMTP / POP3 / load / ...) but closer to the user behavior.

I was thinking of a script installed on a server B:

  • B sends an e-mail to A
  • A sends an automatic reply to B
  • B knows that the mail service works well.
  • This test B restarts every 30 minutes.
  • If B has not received responses, it sends an alert message.
  • B could also control round-trip propagation of e-mails.

But maybe there is better?

share|improve this question

closed as too localized by Sven, Ward, EightBitTony, Khaled, John Gardeniers Jun 6 '12 at 7:59

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

A perl, php, or powershell script is all I can think of, on a scheduler.

  • Send email
  • Check email
  • If email not received in N minutes, sound alarm

Would be neat if wormly and other services did this, but I do not think they do...

share|improve this answer

***I'm assuming the user on B can send and receive emails

On B, you need to do the following:

1) Create the file /home/user/.forward with the following:


This script will forward emails received by B to

2) Create the file /home/user/

This will read the auto-reply email and decide whether the server is ok or not (I'm not going to write the script for this)

But an example of handling data in


echo  > /home/user/test.txt

while read mail_data
        echo $mail_data >> /home/user/test.txt

3) create the file, with:

echo hello |  mail -s "test"

this will send the email out to A to test if it's alive

4) Add to cron to send this every 30mins

*/30 * * * * /home/user/
share|improve this answer
I appreciate your answer full of details; I can easily do the rest. For my case, emails will be forwarded by A, so the main part of the test and alert would be done by B (if A crashs). – crazyfr Jun 11 '12 at 14:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.