Re: CFPOP MessageRemovedException Error
Are you using the messagenumber or uid when you delete the messages? This is a bit of a vague memory but I seem to remember that messagenumber cannot be relied upon 100% and that uid works better. Sorry that is rather sketchy but may give you an avenue to explore. :-) On 3/22/06, LaCroix, Chris [EMAIL PROTECTED] wrote: I have an application that uses CFPOP and most of the time it runs fine, but every once and a while I receive the following error: Error Message: An exception occurred while retrieving mail. Error Detail The cause of this exception was: javax.mail.MessageRemovedException. My code does the following: 1) Loops though 4 exchange mailboxes 2) Getting header only 3) If error while trying to cfpop send email alert to admin, else process wanted mail items then delete processed items. I can also supply some code if that helps. ColdFusion MX Standard Edition (Version 7,0,1,116466) Windows 2003 Exchange 2003 Thanks, --Chris __ This transmittal may be a confidential attorney-client communication or may otherwise be privileged or confidential. If it is not clear that you are the intended recipient, you are hereby notified that you have received this transmittal in error; any review, dissemination, distribution or copying of this transmittal is strictly prohibited. If you suspect that you have received this communication in error, please notify us immediately by telephone at 1-860-275-8200, or e-mail at [EMAIL PROTECTED] and immediately delete this message and all its attachments. __ This email has been scanned by the MessageLabs Email Security System. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235983 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
RE: CFPOP MessageRemovedException Error
I am using messageNumber to delete the messages, but I error before that. Unless you thinking the message I tried to delete is causing an error the next time the process ran again. FYI: This morning I received this sporadically for over two hours, but have not received the error for the last 3 hours. -Original Message- From: Michael Traher [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 22, 2006 1:44 PM To: CF-Talk Subject: Re: CFPOP MessageRemovedException Error Are you using the messagenumber or uid when you delete the messages? This is a bit of a vague memory but I seem to remember that messagenumber cannot be relied upon 100% and that uid works better. Sorry that is rather sketchy but may give you an avenue to explore. :-) On 3/22/06, LaCroix, Chris [EMAIL PROTECTED] wrote: I have an application that uses CFPOP and most of the time it runs fine, but every once and a while I receive the following error: Error Message: An exception occurred while retrieving mail. Error Detail The cause of this exception was: javax.mail.MessageRemovedException. My code does the following: 1) Loops though 4 exchange mailboxes 2) Getting header only 3) If error while trying to cfpop send email alert to admin, else process wanted mail items then delete processed items. I can also supply some code if that helps. ColdFusion MX Standard Edition (Version 7,0,1,116466) Windows 2003 Exchange 2003 Thanks, --Chris __ This transmittal may be a confidential attorney-client communication or may otherwise be privileged or confidential. If it is not clear that you are the intended recipient, you are hereby notified that you have received this transmittal in error; any review, dissemination, distribution or copying of this transmittal is strictly prohibited. If you suspect that you have received this communication in error, please notify us immediately by telephone at 1-860-275-8200, or e-mail at [EMAIL PROTECTED] and immediately delete this message and all its attachments. __ This email has been scanned by the MessageLabs Email Security System. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235984 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
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:235987 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
Re: CFPOP MessageRemovedException Error
I think the messagenumber relates to the set you have retrieved, but is not unique, so if you are the only process accessing the mailbox then all is well, but if another process removes a message between you selecting the headers and then trying to do something else with them the messagenumber may now refer to another message. I think using uid is more robust - whether it is the root of your problem is hard to tell... On 3/22/06, LaCroix, Chris [EMAIL PROTECTED] wrote: I am using messageNumber to delete the messages, but I error before that. Unless you thinking the message I tried to delete is causing an error the next time the process ran again. FYI: This morning I received this sporadically for over two hours, but have not received the error for the last 3 hours. -Original Message- From: Michael Traher [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 22, 2006 1:44 PM To: CF-Talk Subject: Re: CFPOP MessageRemovedException Error Are you using the messagenumber or uid when you delete the messages? This is a bit of a vague memory but I seem to remember that messagenumber cannot be relied upon 100% and that uid works better. Sorry that is rather sketchy but may give you an avenue to explore. :-) On 3/22/06, LaCroix, Chris [EMAIL PROTECTED] wrote: I have an application that uses CFPOP and most of the time it runs fine, but every once and a while I receive the following error: Error Message: An exception occurred while retrieving mail. Error Detail The cause of this exception was: javax.mail.MessageRemovedException. My code does the following: 1) Loops though 4 exchange mailboxes 2) Getting header only 3) If error while trying to cfpop send email alert to admin, else process wanted mail items then delete processed items. I can also supply some code if that helps. ColdFusion MX Standard Edition (Version 7,0,1,116466) Windows 2003 Exchange 2003 Thanks, --Chris __ This transmittal may be a confidential attorney-client communication or may otherwise be privileged or confidential. If it is not clear that you are the intended recipient, you are hereby notified that you have received this transmittal in error; any review, dissemination, distribution or copying of this transmittal is strictly prohibited. If you suspect that you have received this communication in error, please notify us immediately by telephone at 1-860-275-8200, or e-mail at [EMAIL PROTECTED] and immediately delete this message and all its attachments. __ This email has been scanned by the MessageLabs Email Security System. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235989 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
RE: CFPOP MessageRemovedException Error
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 strongExchange Server:/strong #strRecServer# br / strongError Message:/strongbr /#cfcatch.message#br / strongError Detail/strongbr /#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
RE: CFPOP MessageRemovedException Error
One lock just before the cftry ending just before the /cfloop cflock name=[EMAIL PROTECTED] type=exclusive timeout=60 . /cflock Should stop the problem... Paul -Original Message- From: LaCroix, Chris [mailto:[EMAIL PROTECTED] Sent: Wednesday, 22 March 2006 20:05 To: CF-Talk Subject: RE: CFPOP MessageRemovedException Error 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 strongExchange Server:/strong #strRecServer# br / strongError Message:/strongbr /#cfcatch.message#br / strongError Detail/strongbr /#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:236002 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