Copy link to clipboard
Copied
Hi,
The issue I have is that I have a bunch of emails that were undelivered because the password of the email addresse used for CFMail was changed. I was not aware of the problem for a day or so. So, there a bunch of undelivered emails. I am able to update the password and CFMail on webpages are now working.
S
I would like to resend the undelievered mails.
From the Administration portal, Server Settings, Mail section, I can "respool" undelivered mails.
When I "respool" an undelivered mail, it will disappear from the listing, but will reappear a few minutes later.
I tried manually moving an undelivered mail from the "Undelivr" folder to the "Spool" folder. The .cfmail file will move back to "Undelivr" folder a few minutes later.
Opening up one of the .cfmail file, I saw that there is a password on the file.
So, I found correct "password" from the .cfmail file in the Spool folder by triggering a webpage that uses CFMail to send email and open up the .cfmail file in the Spool folder before the .cfmail went away.
I replaced the password in the Password line in one of the undelivered .cfmail file, saved it (now with a new modified time) and moved it to Spool folder.
Most of the times, the modified .cfmail will go back to "Undeliver" folder.
The entry on the mail.log is "Error","scheduler-2","10/30/25","07:10:34","","javax.mail.MessagingException"
Entry on mailsent.log is
"Information","scheduler-2","10/30/25","07:10:34","","Moved undelivered mail: Mail4438428978218712914.cfmail to C:\ColdFusion2021_2\cfusion/Mail/Undelivr directory"
Entry on exception.log is
Hi @Charlie Arehart ,
If I were to create a file in Notepad++ and then, copy the whole content of .cfmail in it. Save it as file1.cfmail and put it in the Spool folder, the email will be sent!!
But, if I were renaming the original undelivered file or making a copy of the original undelivered file, the email cannot be sent.
I tried renaming the undelivered .cfmail and move it to Spool folder. Email will not sent. Same error as first reported.
I tried making a copy of the undelivered .cfmail
...Based on the finding that creating a .cfmail file in Notepad++ with content of a .cfmail file in the Undelivr folder will send email when it is put in the Spool folder, I tried to use Powershell script to create the files.
I found files created using Copy will not work.
# Copy file WITH content
Copy-Item -Path $sourceFile -Destination $destinationFile -Force
But, files using the below syntax WILL work!
# Create new file and write content
New-Item -Path $destinationFile -I
Copy link to clipboard
Copied
Suggestions:
Copy link to clipboard
Copied
Upgraded my Cold Fusion 2021 to version 22, but the results were the same, i.e. Undelivered emails cannot be resent.
Then, I moved an unaltered .cfmail from Undlelivered to Spool.
I got this in mail.log:
"Error","scheduler-1","10/30/25","10:49:04","","javax.mail.AuthenticationFailedException: 535 5.7.139 Authentication unsuccessful, the user credentials were incorrect. [BN0PR04CA0041.namprd04.prod.outlook.com 2025-10-30T14:48:47.605Z 08DE1791F4D9062F]"
This said that the user credentials were incorrect. That was why this email was in Undelivered to begin with. The password on the account has changed.
Then, I moved an altered .cfmail file from Undelivered to Spool. I got the below in mail.log
"Error","scheduler-1","10/30/25","10:50:06","","javax.mail.MessagingException"
and got the below in exception.log
Copy link to clipboard
Copied
dchan@gfc.state.ga.u, you're on the right track with your approach. As for why it failed, that's not clear. But I have a suggestion.
1) First, yes, the root problem is that when the cfmail ran while the incorrect smtp server password was defined in the admin (or cfmail itself), cf put an encrypted version of that into each mail file. When it could not be delivered, it was put into undelivr.
The next problem is that Cf does not itself alter that mail in undelivr when you may correct it in the admin. So yes the solution is what you did: create a new mail, catch it in the spool folder, copy that password line (and user name if it changed), and replace the corresponding lines in the undelivr mails that failed for that incorrect username/pwd. Then move them back into the spool.
None of that is new or changed in any cf version or update. And none should require cf be stopped. I've done this hundreds of times helping people over the years.
2) So why the error? Well, first I would wonder if you made any mistake at all in replacing those two lines. We can't know from your screen shots.
And even if you made the exact right cut and paste you should have, the problem may be that the editor you used injected a special character or changed the encoding to be different from what it started as. Did you edit the mail file on the server? With what editor?
(Indeed, I would always warn folks doing this to SAVE a copy of the mail file before manipulating it, in case anything goes amiss. Then you could compare them to your change to confirm differences.)
2a) As for that potential editor difference, it may seem "too late" for you with those failing files, but not necessarily. Editing them on the server (running its OS) with something simple (like notepad) might suffice to rectify things. Or you may need to use a better editor giving more control over things, like vscode.
3) Until you fix the bad files (of either kind), you may want to remove them from undelivr so that you need not worry about putting them back in the spool (if you get new ones that fail delivery to the smtp server for some other reason).
Finally, while it's fortunate you don't find the (new) bad file remaining in the spool blocking ALL mail sending, if one did they'd just want to remove it from the spool folder.
Hope that helps. You absolutely should be able to do what you're attempting.
Copy link to clipboard
Copied
Thanks for the reply.
From what you said, since I am using the same account to sent email, but the password has changed, if I were to correct the password in the cfmail file, I should be able to move the file to Spool folder and the email will be sent. Right?
I was just using Notepad to make edit. Now, I got Notepad++.
This is the .cfmail file from a successfully sent from webpage. I saved it as .txt
This is a modified .cfmail file with the current password that could not be resent by moving to Spool folder.
I compared the first 5 lines of both files, they were EXACTLY the same. Why the modified file could not be sent?
Thanks.
Dchan
DChan
Copy link to clipboard
Copied
Yes, in answer to your first question.
As for you renaming the .cfmail file to .txt, why? Try skipping that step.
Also, your screenshot is missing the bottom line. Watch that for encoding info.
Most important, recall that your edited file may have been messed up by a previous edit.
If you want to "prove" that this process works, cut a newly created cfmail out of the spool, edit it (simply replacing the password line, though not "needed"), then save it back into the spool. Does it get out?
Then the problem HAS to be in something about the previously failing files you're editing.
Copy link to clipboard
Copied
Hi @Charlie Arehart ,
If I were to create a file in Notepad++ and then, copy the whole content of .cfmail in it. Save it as file1.cfmail and put it in the Spool folder, the email will be sent!!
But, if I were renaming the original undelivered file or making a copy of the original undelivered file, the email cannot be sent.
I tried renaming the undelivered .cfmail and move it to Spool folder. Email will not sent. Same error as first reported.
I tried making a copy of the undelivered .cfmail and move it to Spool folder. Email will not sent. Same error as first reported.
dchan
Copy link to clipboard
Copied
Based on the finding that creating a .cfmail file in Notepad++ with content of a .cfmail file in the Undelivr folder will send email when it is put in the Spool folder, I tried to use Powershell script to create the files.
I found files created using Copy will not work.
# Copy file WITH content
Copy-Item -Path $sourceFile -Destination $destinationFile -Force
But, files using the below syntax WILL work!
# Create new file and write content
New-Item -Path $destinationFile -ItemType File -Force | Out-Null
Set-Content -Path $destinationFile -Value $content
Disclaimer: I asked ChatGPT to write Powershell scripts for me and it worked great!
Also, the .cfemail file has the correct email address and password in them.
Just want to report back on how things went.
Dchan
Copy link to clipboard
Copied
Thanks for the update, dchan@gfc.state.ga.u .
Comparing the screenshots, I wonder: could it be that the CC address is invalid?
Something to test: add -Dmail.smtp.sendpartial=true to java.args in ColdFusion’s jvm.config file.
Then restart ColdFusion.
[mail.smtp.sendpartial=true is a JavaMail system property that tells the SMTP transport: “If a message has multiple recipients and some are rejected by the SMTP server, still send the message to the valid ones instead of failing entirely.”
By default, the property is false.
Note that the setting will apply globally to all JavaMail operations (and therefore to all <cfmail> tags) in the ColdFusion instance.]
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi dchan@gfc.state.ga.u , has the issue been resolved?
If so, could you please provide a summary of the solution.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now