At 03:58 PM 11/9/2004, you wrote:
>In about two weeks, our mail server will be going down for a couple of
>days.  Consequently, any messages sent by Cold Fusion during that time
>will not be delivered.
>
>Does the CF server maintain these undelivered messages anywhere?

As mentioned, in the spool directory.

But in addition to your planned outage, if there
are hiccups or whatever, you'll end up with some emails
there on occasion. I set up a task that runs every 15 minutes
or so to copy anything it finds in undelivr to spool. Here's
the code. You've probably got some sitting in there
right now. ;)

--Anders




<!--- --------------------------------------- --->
<!--- task-moveStuckEmailToSpool.cfm--------- --->
<!--- --------------------------------------- --->
<CFSET gBaseMailDirectory = "#server.coldfusion.rootdir#\Mail\">


<CFSET stuckEmailDir="#gBaseMailDirectory#undelivr">
<CFSET sendEmailDir="#gBaseMailDirectory#spool">

<CFDIRECTORY
     action="LIST"
     directory="#stuckEmailDir#"
     name="undeliveredEmail"
     filter="*.cfmail">

<CFOUTPUT>
Undeliverable directory: #stuckEmailDir#
<p>

<ol>
<CFLOOP query="undeliveredEmail">
     <CFSET fullFileName="#stuckEmailDir#\#undeliveredEmail.Name#">
     <li>#fullFileName#
     <CFFILE
         ACTION="MOVE"
         SOURCE="#fullFileName#"
         DESTINATION="#sendEmailDir#">
</CFLOOP>
</ol>


<!---
<CFDIRECTORY
     action="LIST"
     directory="#sendEmailDir#"
     name="spooledEmail"
     filter="*.cfmail">

<p>
Spool<br>
#sendEmailDir#<p>

<CFLOOP query="spooledEmail">
#spooledEmail.Name#<br>
</CFLOOP>
--->

<CFFILE action="APPEND" file="#gBaseDirectory#tasklog.txt"
     
output="#DateFormat(Now(),"yyyy-mm-dd")#-|-#TimeFormat(Now(),"HH:mm:ss")#-|-TASK--Email-Spool-----#undeliveredEmail.recordCount#"
     addNewLine="Yes">
<p>
Page complete
</CFOUTPUT>

+===========================================================+
|Anders Green                 Email: [EMAIL PROTECTED]       |
|                              Home: 919.303.0218           |
|        Off Road Rally Racing Team: http://LinaRacing.com/ |
+===========================================================+


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183801
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to