AppConnector Cookbook: A Spam Flood Notifier

End-user Problem Statement:
You're an IT Director. Your mail server runs on Windows 2000 and uses a directory to queue incoming messages. You want to be notified as soon as this queue becomes heavily loaded, by excessive spamming for instance, so that you can take the appropriate action in time to avoid mail delays for your users.

Motivation:
I'm that "IT Director"! 8-|
I got up this morning and found that my mail server has been so heavily bombarded by excessive spams for the last 12 hours that our SpamAssassin filter was fuming, and there were in excess of 2000 messages stuck in the queue, and the number was rising. All hell broke loose! It took me three hours to stabilize the spam filter and clear out the message queue.

A couple times a year, we tend to run into little fiascos like these. Alas, with each problem comes opportunity.

Techie Translation of Problem Statement:
Need a utility that lets grumpie here monitor a directory for changes, and it should email him when a directory content has exceeded a certain maximum number of files (say 1000).

Solution:
I don't know if Windoze server provides any built-in way to do what's required, but as the old adage goes: Stick with what you know. So here goes...

Use AppConnector with the following recipe:

Ingredients:
- 1 Default Adapter
- 1 File Monitor event
- 1 Script task, with 1 input parameter
- 1 Mail Task
- some angel dust

Instructions:

  1. Start warming an empty KAP in 23C temperature environment for comfort
  2. Add new application using Default Adapter
  3. Add Script Task, sprinkle in 1 input parameter for flavour.
  4. Add File Monitor event, set monitored directory to be the mail queue directory, notification type to ONLY ADDED FILES, and let it simmer.
  5. Back to Script task, add a couple of lines of script to check number of files in the the directory. Set script so that if this number is below the set limit, it should FAIL. Otherwise, it should SUCCEED, to allow the successor task to run.
  6. Add Mail task as a successor of Script task. Configure it to send email to IT director with an appropriate message body. Sprinkle in some angel dust for taste and stir well.


Test well before serving.

2 comments:

Anonymous said...

If your mail server were bogged down, how could it send out the notification email to your IT director to say that it's bogged down? ;-)

Thanh Hai Tran said...

Good question.
In my case, eventhough the inbound message queue was ginormous, the server seemed to have had no problem in delivering internal mails. ;-)