Yet another project - announcing SpoolMail

So - here is a problem. You use <cfmail> to generate some mail on your dev box. Since you aren't hooked up to a "real" mail server, to check the mail you need to dig down to your undelivered folder. Wait for it to show up. Open the file, and then ignore all the mail header junk and see if the mail came out ok. This works - but is a pain. Especially now that I run multiple ColdFusion servers under JRun. Sure I could add a shortcut to my desktop, but then I'd have to minimize my desktop, and that's just too much work.

Enter SpoolMail.

What is SpoolMail? It is an extension that lets your ColdFusion Administrator read the mail in the undelivered folder in a HotMail/GMail type interface. You can even delete the mail or move it back to the spool. Even better - it has a luscious interface that just screams art! You want to look at this project. You need to. You want to hang it on your wall and rip up the Monet wasting space there now.

Enjoy. It is version 0 which means, basically, I wrote it real quick and didn't do a lot of QA on it. In theory, it could cause global warming. It could even make you cry, but most likely it won't cause anything worse than a hangnail. I'd mention my wishlist, but Lord knows I've only about ten thousand times on the blog.

Today's build was brought to you buy Freur, Sia, Cocteau Twins, Saint Etienne, and This Mortal Coil, AKA known as my "Depressing as Hell" playlist.

Comments

Ray, that extension is a beautiful thing :)

and works great :))
# Posted By Malcolm Hawker | 1/16/06 5:51 PM
You da man, Ray !

You just keep making my life easier and easier and easier...
# Posted By The Rabid CF Developer | 1/16/06 5:55 PM
very cool Ray.

Can I use this outside the CF Administrator? B/c our host doesn't allow us direct access to the Administrator. But we do have access to the mail directory paths and all the .cfmail files.
# Posted By Brett Liotta | 1/16/06 6:11 PM
Very cool. I added it to the open-source project list.
# Posted By Brian Rinaldi | 1/16/06 6:25 PM
nigga you is crazy!

nice idea though.

havent implemented yet, but the intro alone has now compelled moi!

adios
tw
# Posted By tony of the weeg clan | 1/16/06 10:51 PM
have implemented right away, It works great thanks.
# Posted By Frank Gerritse | 1/17/06 4:50 AM
Hi Ray,

I think your code is really cool, we can check our bounce mails and your code exposed alot thing we can do very easily.

Thanks for your great code.

Thanks

Sana
# Posted By Sana Ullah | 1/17/06 5:36 AM
You had me at <cfmail>.
# Posted By Phillip Senn | 1/17/06 7:57 AM
i absolutely KNEW this post would garner responses like this, that was funny as hell phillip, thanks for the smile this marnin'

tw
# Posted By tony of the weeg clan | 1/17/06 8:02 AM
Ohmigawd. w00t!
# Posted By ross | 1/17/06 8:49 AM
Brett, yes. Just put the files anywhere - although you may want to add password protection to it.
# Posted By Raymond Camden | 1/17/06 9:10 AM
Can this be used on CF MX6.1?
# Posted By Robo | 1/17/06 10:01 AM
Robo - yes. It should work just fine. Probably even in CF5.
# Posted By Raymond Camden | 1/17/06 10:06 AM
Oops - I forgot that I used App.cfc. Phillip Duba sent me an app.cfm version. I'll proably switch to that later. Anyway - for those of you on 6.X, you will need to rewrite the app.cfc. But it shouldn't take long.
# Posted By Raymond Camden | 1/17/06 10:18 AM
Hey Ray, can you explain the "or 1" thing below? I've never seen this shorthand.

isDefined("url.reinit") or 1
# Posted By Brett Liotta | 1/18/06 10:25 PM
isnt 1 = yes = on = a positive thereby always boolean for yes, 1, on etc...

so basically its going to happen either way, whatever follows. so then, i ask, whats the point of checking for the existence?

its not a bitwise or operation, so i dont think its that.

must be like 1 or 1 really, since the isDefined("") returns 1 if its true.

right?
# Posted By tony of the weeg clan | 1/18/06 10:32 PM
Brett, it is a mistake. :) It is my way of telling to app to reinit on every request. I do this when I'm developing something. In this case, I simply forgot to turn it off! I'll update the app tomorrow.
# Posted By Raymond Camden | 1/19/06 12:19 AM
lol. that's pretty funny. you know I was thinking maybe it's just an override b/c he didn't feel like commenting out the cfif lines. but that was after I posted. heh, that's a good one.
# Posted By Brett Liotta | 1/19/06 12:27 AM
Ray, can you explain this? why do you tell cf to ignore the runtime.abortexception?

<cfif structKeyExists(arguments.exception, "rootCause") and structKeyExists(arguments.exception.rootCause, "type") and arguments.exception.rootCause.type is "coldfusion.runtime.AbortException">
<cfreturn>
</cfif>

Thanks.
# Posted By Brett Liotta | 1/19/06 12:51 AM
There is a bug where cflocation (or cfabort, I always forget) will fire onError. That code is there to make it ignore it.

FYI - I'll be updating the zip today to use APp.cfm. Someone sent me the conversion already so it won't take long. This will let the app work with CF6. (And CF5 I'm sure.)
# Posted By Raymond Camden | 1/19/06 8:18 AM
Ray, you are the man. This is so simple and beautiful. Thanks a bunch.
# Posted By Sung | 2/8/06 2:22 PM
Just checked it out; looks awesome!

The one thing I have besides this for managing the spool is a text-mode file manager with built-in fast viewer (Far) - but this is loads easier.

One huge addition would be to extract the relevant line(s) from mail.log (and mailsent.log for 6/7) for that spool filename to get the exact error. Would be version-specific, and requires searching through 1-2 potentially big logfiles that may be locked, so may be more trouble than it's worth, unless it's possible to read those without locking.
# Posted By David Lakein | 2/13/06 9:35 PM