1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 127: | <!--
CF_POPREPLY 1.02
Cold Fusion 3.0 POP mail answering machine
(c) 1 Dec 97 by Matthias Wjst (wjst@gsf.de)
bugfixes in 1.01 by 15 Jan 98
* time stamp of sender may wrong, therefore only absolute time checking
* reading blacklist now in loop
* added to blacklist listproc
* better email recognition
-->
<CFIF #ParameterExists(Attributes.LastInterval)#
AND #ParameterExists(Attributes.LastUnit)#
AND #ParameterExists(Attributes.PopServer)#
AND #ParameterExists(Attributes.PopUser)#
AND #ParameterExists(Attributes.PopUserPassword)#
AND #ParameterExists(Attributes.WorkingDir)#
AND #ParameterExists(Attributes.Replytext)#>
<CFIF #Attributes.LastUnit# is "Day">
<CFSET #unit#="D">
<CFELSEIF #Attributes.LastUnit# is "Hour">
<CFSET #unit#="H">
<CFELSEIF #Attributes.LastUnit# is "Minute">
<CFSET #unit#="N">
<CFELSEIF #Attributes.LastUnit# is "Second">
<CFSET #unit#="N">
<CFELSE>
error: correct time interval needed
<CFABORT>
</CFIF>
<CFELSE>
error: more parameters needed
<CFABORT>
</CFIF>
<CFFILE Action="WRITE"
File="#Attributes.WorkingDir#popreply.txt"
OUTPUT="#Attributes.Replytext#">
<CFIF #FileExists("#Attributes.WorkingDir#popreply.cmd")#>
<CFFILE Action="DELETE" File="#Attributes.WorkingDir#popreply.cmd">
</CFIF>
<CFPOP SERVER=#Attributes.PopServer#
USERNAME=#Attributes.PopUser#
PASSWORD=#Attributes.PopUserPassword#
ACTION=GETALL
NAME="Sample">
<CFIF #ParameterExists(ACT_MAILS)#>
<CFLOOP QUERY="Sample">
<CFX_POP3DATE DateMail=#Sample.date#>
<CFIF #DateDiff(unit,DateMail,Now())# lt #(int(Attributes.LastInterval)#>
<CFIF #FindNoCase("gateway",Sample.from,1)# is "0"
AND #FindNoCase("dispatch",Sample.from,1)# is "0"
AND #FindNoCase("prts",Sample.from,1)# is "0"
AND #FindNoCase("notesys",Sample.from,1)# is "0"
AND #FindNoCase("netlib",Sample.from,1)# is "0"
AND #FindNoCase("MAILER-DAEMON",Sample.from,1)# is "0"
AND #FindNoCase("root",Sample.from,1)# is "0"
AND #FindNoCase("0000-Admin",Sample.from,1)# is "0"
AND #FindNoCase("digi-info",Sample.from,1)# is "0"
AND #FindNoCase("digi-request",Sample.from,1)# is "0"
AND #FindNoCase("ftp-list",Sample.from,1)# is "0"
AND #FindNoCase("ftp-mail",Sample.from,1)# is "0"
AND #FindNoCase("ftpadmin",Sample.from,1)# is "0"
AND #FindNoCase("ip-addr",Sample.from,1)# is "0"
AND #FindNoCase("ip-oper",Sample.from,1)# is "0"
AND #FindNoCase("listproc",Sample.from,1)# is "0"
AND #FindNoCase("listserv",Sample.from,1)# is "0"
AND #FindNoCase("mail-server",Sample.from,1)# is "0"
AND #FindNoCase("daemon",Sample.from,1)# is "0"
AND #FindNoCase("mirror",Sample.from,1)# is "0"
AND #FindNoCase("netserv",Sample.from,1)# is "0"
AND #FindNoCase("responder",Sample.from,1)# is "0"
AND #FindNoCase("win-ip-admins",Sample.from,1)# is "0"
AND #FindNoCase("mirror",Sample.from,1)# is "0">
<CFSET Start = REFind("[-a-zA-Z0-9\._]+@([-a-zA-Z0-9_]+\.)+([a-zA-Z]{2,3})", from, 1)>
<CFIF Start eq "0">
<CFSET Start = "1">
</CFIF>
<CFSET Stop = REFind("[^-a-zA-Z0-9@_\.]", from, Start)>
<CFIF #Stop# is not "0">
<CFLOOP CONDITION="REFind('[A-Za-z]', Mid(from, Stop, 1)) GT 0">
<CFSET Stop = Stop - 1>
</CFLOOP>
<CFSET email= Mid(from, Start, Stop - Start)>
<CFELSE>
<CFSET email= mid(from, Start, len(from))>
</CFIF>
<CFIF #FileExists("#Attributes.WorkingDir#popreply.black")#>
<CFFILE Action="READ"
File="#Attributes.WorkingDir#popreply.black"
Variable="blacklist">
<CFELSE>
<CFSET #blacklist#="">
</CFIF>
<CFIF #FindNoCase(email,blacklist,1)# is "0">
<CFFILE Action="APPEND"
File="#Attributes.WorkingDir#popreply.black"
OUTPUT="#email#">
<CFFILE Action="APPEND"
File="#Attributes.WorkingDir#popreply.log"
OUTPUT="blat popreply.txt -t #email# -s #chr(34)#Re: #left(Sample.subject,19)##chr(34)#">
</CFIF>
</CFIF>
</CFIF>
</CFLOOP>
<CFIF #FileExists("#Attributes.WorkingDir#popreply.cmd")#>
<CFX_SHELLEXEC FILE="popreply.cmd" DIRECTORY="#Attributes.WorkingDir#">
</CFIF>
</CFIF>
|