Skip navigation
Currently Being Moderated

cfmail undeliverable hell

Apr 16, 2012 12:05 PM

Tags: #cfmail

Running CF 9.0.  Every now and then a mail file will end up in the undelivr folder.  For example our external SMTP server is twitchy, and sometimes there is no connection (briefly).  Other times it's impossible to tell why the mail fails to be sent.  The mail log says "The ColdFusion mail spool encountered an invalid spool file..." and of course the file is moved to the undelivr directory.


Well... once there I cannot get the mail to send by moving it back to the spool directory.  Once the file ends up as undeliverable it will not go.  It just gets re-sent to the undelivr folder.


These emails are not malformed.  They are automated messages to me and other ediotors that something has occurred on the server.  Email addresses are good, etc. These scripts are many years old and they have always works flawlessly until CF9.  Trust me, the files should go out just like all the other ones that do.


OK, I've searched this forum and the Internet for like problems and fixes.  I've tried restarting CF and then moving the files back to the spool, deleting the first file that didn't go out (if more than one file is in the undelivr folder), and saving as ASCII, UTF-8 no BOM, and even copying & pasteing the mail into notepad and saving back to the spool.  I've tried turning off TLS.  (The SMTP server is SSL)  I've tried turning off the spooler.  Nothing works.  No matter what I have tried, if it ends up in the undelivr directory it will not go out from the spooler.


Has anyone any ideas?  I've been programming CF since version 4 and I can usually figure these types of things out, but this one is a tough one.  Any help would be appreciated.

  • Currently Being Moderated
    Apr 16, 2012 2:21 PM   in reply to RobbienSly



    I wonder if it's actually embedding something in the file that marks it as "bad". You might try an experiment. Send yourself a test email and watch the spool so you can copy out your test email while it's there awaiting processing, and then send an idential message but break something first (close a port or something) so that the second email fails, and copy it out as well. Then run a diff on the two files and see what's different (besides the timestamps, etc.). Might not net anything, but who knows? If you figure this one out, I'm definitely going to want to know the answer. Best of luck.



    Mark as:
  • Currently Being Moderated
    Apr 25, 2012 7:58 AM   in reply to RobbienSly

    We had a problem when we migrated to CF9  from 8- the cfmail structure worked a little different and it took us ages to work out what was going on...


    On CF8 this worked


    <cffmail subject="Foobar" to="" from="Fred Bloggs">...</cfmail>


    However, failed on CF9 - it turns out that on 9 it doesn't like the "from" being an undefined email with a space in the name  -although if it said just "Fred", then it would work, which was why it took us so long to work out and may explain your apparently random issue.  So, to get round it we had to restructure all our code like so:


    <cffmail subject="Foobar" to="" from="Fred Bloggs <>">...</cfmail>


    No idea if this is related to your problem, but it may be!

    Good luck!

    Mark as:
  • Currently Being Moderated
    Sep 1, 2012 8:46 AM   in reply to RobbienSly

    You are not the only one having this issue. We have the same issue on CF 10 and Solaris 11. I have be troubleshooting this now for two days. I am trying to track down the change made to the file. However, we have a script written in the dos batch environment that has worked for 7+ years and now we cannot use it any more. I will post the finding if I find a cure. BTW Adobe does not support Solaris 11 yet.

    Mark as:
  • Currently Being Moderated
    Nov 21, 2012 2:26 PM   in reply to nicxen

    We have been having the same problem through all versions of Coldfusion, and I think I finally found the answer.


    Although the files look the same, I suspect CF does something in the background when looking at the charset of the mail.  All of our undeliverable mail had no charset definition.  The first line of the CFMAIL file looked like this:


    type:  text/plain


    If the mail went thru when it was originally sent, everything was fine.  But if the mail was determined undeliverable (for whatever reason) and wound up in the undelivr folder, no matter how many times we tried to respool it (even after the brute force effort of stopping and starting CF Server) it would not go.  I found another thread that had a similar problem and solved it by adding the default charset definition of the server to the "type" definition line.  So I edited the mail file and changed this line to look like this:


    type:  text/plain; charset=UTF-8


    And magically, all the mail I added the charset definition to went thru.  Maybe it's a bug that the CF people can fix and patch for us.


    Happy Thanksgiving!

    Mark as:
  • Currently Being Moderated
    Jan 24, 2013 8:47 AM   in reply to RobbienSly

    We have this same issue whenever our mail server goes offline except we have CF10.


    Here's a quick sequence of events of error and resolution I performed this morning:


    Mail server goes offline for a brief period of time.

    Messages in Spool folder gets stuck and are sent to undeliverable folder

    Mail server goes back online

    We manually move the emails from undeliverable to spool

    Depending on the volume of emails, some email which have always worked for years, ends right back to the undeliverable folder

    In the case I ran into today, out of 3 undeliverables, 1 did not want to go through for some reason, I suspected it maybe because of the attachment, but this was not it.

    I checked the CF mail error log and found this:

    ""Error","scheduler-0","01/24/13","09:26:20",,"javax.mail.MessagingExc eption: missing body for message"

    javax.mail.MessagingException: missing body for message

              at coldfusion.mail.MailImpl.createMessage(

              at coldfusion.mail.MailSpooler.deliver(

              at coldfusion.mail.MailSpooler.sendMail(

              at coldfusion.mail.MailSpooler.deliverFast(




    It made no sense why CF was requiring the body of the email as it normally goes through without issue any other time.

    So, I manually edited the mail in the undelieverable folder and basically copied the subject into the body as well by typing it in the following on a new line at the very end "body:   Random Blabber," then moved it back to the mail folder and it went through...

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points