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:
- delete mail file left from last check
- call msmtp to send an email via our Exchange server (on our LAN) to a gmail account
- gmail account is configured to forward mails from our specified address to a specified mailbox on our Exchange server then delete them
- wait 30 seconds
- 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.
- check for the presence of the file on the linux host (using the syntax of the file existence check already posted here. Thanks Pravinraj!)
- if mail file is present, exit 0 i.e. successful, if not present exit 1 i.e. failure
- 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?