SMTP Event Gateway???

Does anyone know of an SMTP event gateway for ColdFusion>

What I'm looking for, is a way of implementing helpdesk type functionality, whereby any emails to a certain domain are handled by ColdFusion according to a set of rules (e.g. create new issue - add comment to an exiting issue etc.)

It struck me that it should be relatively straightforward to handle incoming SMTP transmissions using a ColdFusion Event Gateway (seeing as SMTP is a relatively simple text based prtocol...) - and I wondered if anyone had already done it - and if not - why not? (I'm presuming I must have overlooked something that would make it more complicated than I anticipate...)

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Kevin Schmidt's Gravatar Seems like it would be a good gateway, but you could also use cfpop to poll a specific address and process the emails that way.

# Posted By Kevin Schmidt | 30/06/08 23:14
Dan Lancelot's Gravatar @Kevin: Indeed - would be quite an overhead though - and would need to have logic for handling different addreses (although a catchall would possibly suffice) - also would add latency - though maybe not too much of an issue.

Much rather have push rather than pull...
# Posted By Dan Lancelot | 30/06/08 23:24
Terry Schmitt's Gravatar I would think you would want to let your email server do what it does best... Handle SMTP traffic.
How about an IMAP gateway? Would that work better then POP3?
Or could your email server somehow signal a CF gateway that mail is waiting?
# Posted By Terry Schmitt | 01/07/08 15:10
Dan Lancelot's Gravatar @Terry: I'm not wanting to do everything that an SMTP server does - only the actual receipt of email.
How would you get the mail server to do that (that's a slightly tounge in cheek question - obviously it depends on the mail server) - it would mean that this couldn't be added as functionality to an app - but would rather be dependant on a specific mail server.
I don't see that POP vs IMAP makes any difference - you'd still need to download the contents of the email in order to process it...
CFPOP may be the best way of doing it - it would be nice though to get rid of the polling / latency / load that that produces...
# Posted By Dan Lancelot | 01/07/08 17:37
Richard Davies's Gravatar I too have been wondering recently what's the best method for allowing CF to respond to e-mails. I haven't had any time to do any research on the topic, but my initial thought was also to use a CF gateway to receive notifications of new e-mail.

I'm interested in hearing how other people who have dealt with this issue handled it.
# Posted By Richard Davies | 01/07/08 20:31
kola's Gravatar Dan

I actually wanted to do something similar myself a while ago and had a quick look into it - IIRC there may be source for an SMTP gateway in one of the older (7) Advanced CFWACKs. Have a butchers on Safari.
# Posted By kola | 06/07/08 12:24
Dan Lancelot's Gravatar @Kola - you're still alive!
Thanks for the heads up - I'll have a search through...
# Posted By Dan Lancelot | 07/07/08 00:33
Rafael Quinones's Gravatar As Terry stated, recreating the wheel and adding another mail server is a bad idea. Email is mission critical to most business and mucking with that could be a career changing event. Some mail servers make it easy to fire of a process when a message arrives, and then there's those mail servers such as MS Exchange. On Exchange, one possible solution is to use directory watcher to monitor the log file directory. When a new message arrives, read the log and check if the message was for support.
# Posted By Rafael Quinones | 06/08/08 05:32
Dan Lancelot's Gravatar @Rafael Both you ant Terry make valid points - but you both seem to be making the assumption that this software will be acting as a general mail server.

This would not be the case - its *merely* a matter of creating an SMTP interface for a particular application to work in conjunction with the existing http interface, using technology in which the hard part (i.e. all the network socket stuff) has already been implemented.

Points about email being mission critical and career changing, whilst true in themselves, are only relevant if the application was handling general mail.

The particular use case for this application dictates that it would be set up on a dedicated domain for email - not on a domain which would be receiving general business email.

Whilst a *better* solution for a specific installation may involve integrating with a specific mail server - this would add an additional dependency which would effectively turn this into a bespoke solution - ideally I'm looking at creating something which can be open sourced - and potentially added to any CF application...
# Posted By Dan Lancelot | 11/08/08 09:45
Bart's Gravatar Hi Dan,

I'm wondering whether you have done anything with your plan of integrating/developing some kind of a SMTP-event gateway. I'm currently looking into a similar functionality...Any great insights or even stuff you can share already?
# Posted By Bart | 29/01/09 19:25
BlogCFC was created by Raymond Camden. This blog is hosted by DotLance Ltd.