Hi,

I have written a script which checks for
AutoResponders on the Mail Server and if found,
deletes it from there. But there is some problem with
the problem while deleting the messages. Like if you
delete first messages and the last message it gives
error. 

Following is a copy of the script:

......... Script .........

<cfset str = "AutoReply, Auto Reply, Auto Responder,
AutoResponder, Automatic response to your mail, Out of
Office, Not in the office">
<cfset delFlag = 0>
<cfset subjectMatch = 0>
<cfset bodyMatch = 0>
<cfset MessageToCheck = 100>
<cfset MessageDeleted = 0>
<cfset MessageToBeDeleted = 0>

<cfpop server="192.168.0.1" username="#username#"
password="#password#" action="getAll"
name="GetHeaders" startrow="1"
maxrows="#MessageToCheck#">

<H3> Message Headers in Your Inbox </h3>
<P> No. of Records:

<cfoutput> #GetHeaders.RecordCount# </cfoutput> </p>

<UL>
<cfoutput Query = "GetHeaders">
        <LI> Row: #currentRow#: From: #From# -- Subject:
#Subject#

        <cfloop index = "index1" list = "#str#" delimiterS =
",">
                <cfset subjectMatch = FindNoCase(trim(#index1#),
trim(#subject#))>
                <cfset bodyMatch = FindNoCase(trim(#index1#),
trim(#body#))>
                <cfif subjectMatch gte 1 or bodyMatch gte 1>
                        <cfset delFlag = delFlag+1>
                </cfif>
        </cfloop> 
        <font color="red"> #currentRow# </font>
        <cfif delFlag gte 1>
                <cfpop server="192.168.0.1" username="#username#"
password="#password#" action="delete"
name="GetHeaders" messageNumber="#currentRow#"> 
                <cfset delFlag = 0>             
                <cfset MessageDeleted = MessageDeleted + 1>
                <cfset MessageToBeDeleted = MessageToBeDeleted + 1>
                <font color="red"> #currentRow# Deleted </font>
        </cfif>
</cfoutput>


<br>
<br>
<cfpop server="192.168.0.1"
username="[EMAIL PROTECTED]##mukundsofts.com"
password="HeidiKriti" action="getAll"
name="GetHeaders" startrow="1"
maxrows="#MessageToCheck#">

<cfoutput> #GetHeaders.RecordCount# </cfoutput> 


......... Script .........

Could you please help me.

Regards.


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to