For too long now, my previous posts on the topic of passing emails to ColdFusion have promised that a future post will deal with how to parse emails in ColdFusion. So I can now happily (and somewhat sheepishly) announce that code for parsing is finally here.
I have a new project up called emailParse.cfc. You pass it the source text of an email, and it returns a struct with all headers, body parts, and attachments parsed out. There are even functions to forward the email on to another address, to try to get the email's context (ie, whether it's a hard bounce, soft bounce, out-of-office reply, or otherwise), and whether the email might be part of a loop. The whole idea is to let you programmatically deal with the emails that come into your server in real time, instead of relying on intermittent CFPOP calls from a scheduled task.
So feel free to try out the email parsing code, and let me know what you think.