-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathemail_pop.cfm
47 lines (35 loc) · 1.13 KB
/
email_pop.cfm
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
<!--- 6598 --->
<cfparam name="url.startRow" default="6598" />
<cfset startRow = url.startRow />
<cfpop
server = "#application.email_server#"
username = "[email protected]"
password = "#application.email_password#"
action = "GETALL"
name = "popmail"
timeout = "120"
startRow = "#startRow#"
generateUniqueFilenames = "no" maxrows="10">
<cfdump var="#popmail#"><cfabort>
<cfif len(popmail.recordcount)>
<cfoutput query="popmail">
<cfif left(from,13) EQ 'MAILER-DAEMON'>
<cfset pointer1 = find('The mail system',TEXTBODY) />
<cfset pointer2 = findnocase(': host',TEXTBODY) />
<cfset stringLength = pointer2 - pointer1 - 21 />
<cfif stringLength GT 0>
<cfset emailAddress = mid(TEXTBODY,pointer1+20,stringLength) />
<cfquery name="insertEmail" datasource="#application.dsource#">
INSERT into email_undeliverables
(messagenumber,email)
values
(#messagenumber#,'#emailAddress#')
</cfquery>
<cfset nextMessagenumber = messagenumber + 1 />
</cfif>
</cfif>
</cfoutput>
<cfelse>
DONE
</cfif>
<cflocation url="email_pop.cfm?startRow=#nextMessagenumber#" addtoken="No" />