I have included my code to see if it helps any.  From what your saying I
should add cflock around the cfpop and the cfdelete?
I assume each step waits for the prior step to complete.

<cfloop query="qryMailServers">
        <cfset strRecServer = #trim(qryMailServers.recServer)#>
        <cfset strRecUsername = #trim(qryMailServers.recusername)#>
        <cfset strRecPassword = #trim(qryMailServers.recPassword)#>
        <cfset bErrorFound = "N">
        <cftry>
                <cfpop server="#strRecServer#"
                   username="#strRecUsername#"
                   password="#strRecPassword#"
                   action="getHeaderOnly"
                   name="qryITagentMail">
        
                <cfcatch type="any">
                        <!--- Error occured with cfpop - send alert mail
to admin--->
                        <cfset bErrorFound = "Y">
                        <cfmail to="strAlertToAddress"
from="#strAlertFromAddress#" 
                                        subject="Email Error
Notification (POP) -- Exchange Server: #strRecServer#" 
                                        type="html">
                                <strong>Exchange Server:</strong>
#strRecServer# <br />
                                <strong>Error Message:</strong><br
/>#cfcatch.message#<br />
                                <strong>Error Detail</strong><br
/>#cfcatch.Detail#<br />
                        </cfmail>
                </cfcatch>
        </cftry>
        <cfif bErrorFound EQ "N">
                <cfloop query="qryITagentMail">
                        <!---Do something with email data then mark item
as ready for deletion--->
                        <cfset iDeleteMsg = iDeleteMsg & "," &
#qryITagentMail.uid#> <!--- messageNumber -- store message number you
want to delete --->
                </cfloop>

                <!--- Delete These messages after processing --->
                <cfset iDeleteMsg = mid(iDeleteMsg,2,len(iDeleteMsg))>
                <cfif trim(iDeleteMsg) NEQ ''>
                        <!--- delete selected mailings --->
                        <cfpop server="#strRecServer#"
                           username="#strRecUsername#"
                           password="#strRecPassword#"
                           action="Delete"
                           messagenumber="#iDeleteMsg#">
                </cfif>
        </cfif>
</cfloop>



-----Original Message-----
From: Paul Vernon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 22, 2006 2:25 PM
To: CF-Talk
Subject: RE: CFPOP MessageRemovedException Error


If you are running multiple requests on the same mailbox you may receive
this error under the following circumstances....

Thread 1 processes mail and starts to delete messages....

Thread 2 connects to the mailbox

Thread 1 completes deleting mail. The mail server renumbers any existing
mails starting from 1 again.

Thread 2 starts processing and attempts to access a messagenumber that
no longer exists. It errors out...

The use of cflock around all of the calls in a particular page using the
name attribute and locking on say [EMAIL PROTECTED] would fix the
issue...

Paul





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235991
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to