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 want to send a mail to an account and after it is received launch a process on the server that uses parameters in the message. Is it possible to do this in Exchange? Something like "shellExecute c:\ message.body"

I have had a look at transport rules but they don't seem to allow for the launching of an external process.

(I am also aware that this may not be possible because it opens up an exploit vector)

share|improve this question
I'm taking it that you're meaning Exchange 2007 (based on your mention of Exchange 2007 transport rules). You might want to add such a tag. – Evan Anderson Jul 6 '09 at 15:56
What are you trying to do with the message contents? – moshen Jul 6 '09 at 16:15
up vote 0 down vote accepted

A custom Exchange Transport Agent would do what you want (but you'd have to pay somebody to code it). I'll include some links at the bottom.

You're probably best off doing something like both Maxwell and Sam Cogan suggest and just poll a mailbox and fire off events based on the mailbox contents. Microsoft claims that Exchange 2007 IMAP supports the IDLE command (see and for background on IDLE) such that, in theory, Exchange can do "push" notifications of new emails to an IMAP client (thus eliminating polling in the IMAP client).

I think I'd go the route of the IMAP client (w/ or w/o IDLE) such that you can easily move the client process off to another server computer if scaling becomes a concern, and so that you're not "tied" to Exchange, should you decide to make a jump to a different mail server platform in the future, or should Microsoft decide (like they've done so many times before) to deprecate the API that transport agents use.

If you want to get brave and go for coding a transport agent, have a look at:

share|improve this answer

I usally do this kind of task with a python script checking a mailbox via IMAP for new emails containing a specified pattern. This might get you started this way. Youcan further 'compile' your script with py2exe and run it as a service.

share|improve this answer

As far as I am aware there is no way to get exchange to trigger an external process. Instead your best bet is to get your script to check a mailbox periodically and then execute the script. If you could hook into activesync you may be able to do it on a push notification.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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