CFMail automatic respooler

ColdFusion , Projects Add comments

When ColdFusion mail fails to deliver it will sit in the undelivr folder forever unless someone copies it back to the spool folder for another try. And even then mail that is actually invalid will just keep ending up back in the undelivr folder forever unless someone deletes it. If either of these folders end up with hundreds of thousands of files in them( which will happen eventually on a busy server), it will stop cfmail working and will affect ColdFusion's performance.

I am quite surprised Adobe have still not addressed this, especially considering they added a new feature to CF9 allowing you to view and MANUALLY respool failed mail, which is ok if you only have a few emails, but as it only displays like like 10 emails at a time, it is useless on a server that processes hundreds of thousands of emails per day.

Up till now I used a little VB script and a windows scheduled task to handle this, but I decided it was time for a CF solution that I could easily just plugin into the cfadmin.

So here it is, a custom extension for your ColdFusion administrator which allows you to specify how often you want to respool your undelivered mail and how long you want to keep trying for, after the retry limit is reached the undelivered mail will just get deleted.

FYI Railo retries sending mails by default.

respooler

DOWNLOAD HERE

readme.txt file in the download contains installation and setup instructions.

you can also turn on verbose output when manually running the scheduler to see what it is doing.

I may also add the option to send a failure notice to the sender for failed mails that get deleted.

If you want the ability to manually view/edit failed mail and send back to the spool then try Ray Camdens Spoolmail.

Change log

1.0.1  - 01/01/2012

Added logging with CFLOG
Added ability to edit/save scheduled task url

1.0.2 - 21/06/2013

Fixed some issues withthe respool task not deleting mails
Set the default url for task to use localhost
Added optional verbose output
Updated the readme

2 responses to “CFMail automatic respooler”

  1. CF Developer Says:
    Thank you so much! This is very very helpful! It also opens the door for me to start creating more custom extensions in Cold Fusion!
  2. Ted Says:
    This is fantastic. Exactly what I was looking for. Hard to believe Adobe has never added this feature.

Leave a Reply

Leave this field empty

Powered by Mango Blog. Design and Icons by N.Design Studio