I need to receive SMTP mail and pipe it to a program. Can the IIS SMTP server deliver mail to a script or program?
I've looked on 2008 R2, but don't see an option for this.
EDIT: This is for a company which processes orders via email. I need to pipe those emails to a script which processes the order. I can think of a few ways to accomplish this in the UNIX world, but would prefer a Windows solution for this project.
The IIS SMTP server is designed to either relay mail to another remote SMTP server or deliver it to a drop folder for local addresses. This means that to deliver an email to a script the script would either have to accept SMTP connections directly, retrieve the email from another server using POP (not the IIS SMTP server though, as it does not implement POP), or most likely poll the local drop folder for new messages and process them. You can configure the local drop folder for a virtual IIS SMTP server here and configure a script to monitor the directory for new files. Since the IIS SMTP server is only a virtual server you don't really have any other options. Exchange server is Microsoft's full SMTP/POP/Messaging server, which may be able to provide more email processing features.
Alternatively you could look into a different SMTP server such as the free XMail server that can be used to run external commands using custom domain processing or message filters. This however requires installing and maintaining a non-Microsoft SMTP server and using that instead of IIS SMTP.
You might need to write a script that will poll using POP or IMAP the server, and pull messages to deliver to the program you're looking for.
Otherwise you'll need to see if you can get a plugin for IIS that will redirect mail or set up a mail proxy that will analyze mail as it goes through and direct mail either to the program you want or to the end user it's intended for.
Are you looking for something to analyze all mail like an antivirus scanner or are you looking for particular messages that are formatted and directed at something like automating another application, so you need to pluck "command mails" out of the mailbox?
You might be able to just redirect mails for a particular address to a specific mailbox if that's the case...
How do you propose it should "deliver mail to a program"? A SMTP server sends or accepts mail between servers and from clients. Accepted mail is stored on the server. If you know where its stored you can then process the received mail.