Checking external mail flow - script available if wanted. Tell us how you check this!

Checking external mail flow - script available if wanted. Tell us how you check this!

Anyone interested in a script to check external mail is working?  Components are a linux VM (Ubuntu) with mpop and msmtp installed to run the scripts on, MS Exchange 2007, a gmail account set up to forward and delete all the mails sent to it and Opmanager with a custom script and a workflow reutilising the same script.

The process is:

  1. delete mail file left from last check
  2. call msmtp to send an email via our Exchange server (on our LAN) to a gmail account
  3. gmail account is configured to forward mails from our specified address to a specified mailbox on our Exchange server then delete them
  4. wait 30 seconds
  5. use mpop to check for new mail on our exchange server and if there write them to a file on the linux host. mpop will delete the mail from exchange once downloaded by default.
  6. check for the presence of the file on the linux host (using the syntax of the file existence check already posted here.  Thanks Pravinraj!)
  7. if mail file is present, exit 0 i.e. successful, if not present exit 1 i.e. failure
  8. use failure of this script check as trigger for a workflow which runs the same check with a 1 minute wait then on failure with a 2 minute wait then alerts via SMS
http://www.postcarbon.org



                  New to ADSelfService Plus?