Re: [WebDNA] Script choking on POP download

This WebDNA talk-list message is from

2010


It keeps the original formatting.
numero = 105861
interpreted = N
texte = --0022152d5f15d436ec04920dd85a Content-Type: text/plain; charset=UTF-8 Olin, Here you go - its basically a modified version of the old Shared_POP3 code. I'm using this for automatic bounce management for a mailing list. So I check for emails that begin with 'bounce-' and only pull them down. You should be able to easily amend it for whatever needs you have though. If anyone can make it more efficient it would be great to post the improvements back to the list. - Tom [!] [/!][!] ------------------------------------ ### Restrict trigger to 5 minute intervals ### [/!][showif [time %M]\5][!] ------------------------------------ ### Set template variables ### [/!][text]thisHost=pop.gmail.com[/text][!] [/!][text]thisUser=your_gmail_or_google_apps_email_address[/text][!] [/!][text]thisPass=your_gmail_or_google_apps_password[/text][!] [/!][text]thisPort=995[/text][!] [/!][text]maxSize=200000[/text][!] [/!][math show=f]numEmails=0[/math][!] [/!][math show=f]downloadEmails=100[/math][!] [/!][text]showDebug=F[/text][!] ------------------------------------ ### Connect to host ### [/!][!] ### Debug message ### [/!][showif [showDebug]=T]

Connecting...

Connecting host=[thisHost] port=[thisPort]
Elapsed-time: [elapsedtime] - Actual time: [time]
[/showif][!] [/!][tcpconnect host=[thisHost]&port=[thisPort]&ssl=T][!] [/!][text show=f]POP3_response=[tcpsend end=%0D%0A][/tcpsend][/text][!] ### Debug message ### [/!][showif [showDebug]=T]POP3_Response={[POP3_response]}
[/showif][!] ------------------------------------ ### 20. Proceed if server responded to POP3 connection request ### [/!][showif [url][POP3_response][/url]!][!] [/!][text show=f]timestamp=<[middle startafter=<&endbefore=>][POP3_response][/middle]>[/text][!] ------------------------------------ ### Set authorisation variable ### [/!][text]Authorization=PASSED[/text][!] ------------------------------------ ### Use normal USER/PASS combinaton for Gmail ### [/!][!] ### Debug message ### [/!][showif [showDebug]=T]

USER...[user]

[/showif][!] [/!][text show=f]USER_response=[tcpsend end=%0D%0A]USER [thisUser][UnURL]%0D%0A[/UnURL][/tcpsend][/text][!] ### Debug message ### [/!][showif [showDebug]=T]USER_response={[USER_response]}
[/showif][!] [/!][showif [GetChars start=2&end=3][USER_response][/GetChars]!OK][text]Authorization=FAILED[/text][/showif][!] [/!][showif [GetChars start=2&end=3][USER_response][/GetChars]=OK][!] ### Debug message ### [/!][showif [showDebug]=T]

PASS...

[/showif][!] [/!][text show=f]PASS_response=[tcpsend end=%0D%0A]PASS [thisPass][UnURL]%0D%0A[/UnURL][/tcpsend][/text][!] ### Debug message ### [/!][showif [showDebug]=T]PASS_response={[PASS_response]}
[/showif][!] [/!][showif [GetChars start=2&end=3][PASS_response][/GetChars]!OK][text]Authorization=FAILED[/text][/showif][!] [/!][/showif][!] [/!][showif [Authorization]=FAILED]Either user name or password is wrong![/showif][!] ------------------------------------ ### 30. Proceed if server responded OK to User / Pass ### [/!][showif [Authorization]=PASSED][!] ### Debug message ### [/!][showif [showDebug]=T]

LIST...

[/showif][!] [/!][text show=f]LIST_response=[tcpsend end=%0D%0A.%0D%0A]LIST[UnURL]%0D%0A[/UnURL][/tcpsend][/text][!] ### Debug message ### [/!][showif [showDebug]=T]LIST_response={[LIST_response]}
[/showif][!] ------------------------------------ ### Get lists of emails with unique identifier ### [/!][text show=f]result=[middle startafter=%0D%0A&endbefore=.][LIST_response][/middle][/text][!] [/!][listwords words=[result]&delimiters= %0D%0A][!] [/!][showif [math][index]%2[/math]=1][text]curIndex=[word][/text][/showif][!] [/!][showif [math][index]%2[/math]=0][text]size[curIndex]=[word][/text][/showif][!] [/!][/listwords][!] ### Debug message ### [/!][showif [showDebug]=T]

Elapsed time: [elapsedtime]

UIDL...

[/showif][!] ------------------------------------ ### Get the header of each email and only check where email begins with 'bounce-' ### [/!][text show=f]result=[tcpsend end=%0D%0A.%0D%0A]UIDL[UnURL]%0D%0A[/UnURL][/tcpsend][/text][!] [/!][text show=f]result=[middle startafter=%0D%0A&endbefore=.][result][/middle][/text][!] [/!][math show=f]numEmails=0[/math][!] [/!][listwords words=[result]&delimiters= %0D%0A][hideif [index]>[math][downloadEmails]*2[/math]][!] [/!][showif [math][index]%2[/math]=1][text]curIndex=[word][/text][/showif][!] [/!][showif [math][index]%2[/math]=0][!] [/!][text show=f]header=[tcpsend end=%0D%0A.%0D%0A]TOP [curIndex] 0[UnURL]%0D%0A[/UnURL][/tcpsend][/text][!] [/!][text show=f]bounce=[include file=getline.inc&find=Delivered-To: &data=[url][header][/url]][/text][!] ### Debug message ### [/!][showif [showDebug]=T][bounce]
[/showif][!] [/!][!] ------------------------------------ ### 40. Proceed if address contains 'bounce-' ### [/!][showif [bounce]~bounce-][!] ------------------------------------ ### Limit size of message download ### [/!][hideif [interpret][size[curIndex]][/interpret]>[maxSize]][!] [/!][math show=f]numEmails=[numEmails]+1[/math][!] ------------------------------------ ### Retrieve Mail ### [/!][!] ### Debug message ### [/!][showif [showDebug]=T]RETR [curIndex] (size: [interpret][size[curIndex]][/interpret]) ...
Message download beginning (Elapsed-time: [elapsedtime])
[/showif][!] [/!][text show=f]thisDownload=[curIndex][/text][!] [/!][text show=f]result=[tcpsend end=%0D%0A.%0D%0A]RETR [curIndex][UnURL]%0D%0A[/UnURL][/tcpsend][/text][!] ------------------------------------ ### Delete email from server ### [tcpsend end=%0D%0A]DELE [curIndex][UnURL]%0D%0A[/UnURL][/tcpsend][/!][!] ### Debug message ### [/!][showif [showDebug]=T]Message downloaded - processing beginning (Elapsed-time: [elapsedtime])
[/showif][!] [/!][text]numChar=[countchars][middle startafter=%0D%0A&endbefore=%0D%0A.%0D%0A][result][/middle][/countchars][/text][!] [/!][text show=f]body=[middle startafter=%0D%0A%0D%0A&endbefore=%0D%0A.%0D%0A][result][/middle][/text][!] [/!][text show=f]header=[getchars start=1&end=[math][numChar]-[countchars][body][/countchars][/math]][middle startafter=%0D%0A&endbefore=%0D%0A.%0D%0A][result][/middle][/getchars][/text][!] [/!][text show=f]theDate=[include file=getline.inc&find=Date: &data=[url][header][/url]][/text][!] [/!][text show=f]theStatus=[include file=getline.inc&find=Status: &data=[url][body][/url]][/text][!] [/!][text show=f]theDcode=[include file=getline2.inc&find=Diagnostic-Code: &data=[url][body][/url]][/text][!] [/!] ADD YOUR OWN CODE HERE TO APPEND DATA ETC [!] [/!][/hideif][!] ### Debug message ### [/!][showif [showDebug]=T]Processing finished (Elapsed-time: [elapsedtime])
[/showif][!] [/!][/showif][!] ------------------------------------ ### 40. End showif ### [/!][/showif][!] [/!][/hideif][/listwords][!] [/!][/showif][!] ------------------------------------ ### 30. End showif ### [/!][!] ### Debug message ### [/!][showif [showDebug]=T]

QUIT...

[/showif][!] ------------------------------------ ### Quit session ### [/!][tcpsend end=%0D%0A]QUIT[unurl]%0D%0A[/unurl][/tcpsend][!] ### Debug message ### [/!][showif [showDebug]=T]

[numEmails] Message(s) Retrieved


[/showif][!] [/!][/showif][!] ------------------------------------ ### 20. End showif ### [/!][!] ### Debug message ### [/!][showif [showDebug]=T][showif [url][POP3_response][/url]=]No Response from the POP3 server.[/showif][/showif][!] [/!][/tcpconnect] [/showif][!] ### Debug message ### [/!][showif [showDebug]=T]Elapsed-time: [elapsedtime] Actual time: [time]
[/showif][!] [/!][!] ------------------------------------ ### Delete last message if script hangs ### [/!][showif [elapsedtime]>60000][showif [showDebug]=T]Message [thisDownload] hanging
[/showif][!] [/!][tcpconnect host=[thisHost]&port=[thisPort]&ssl=T][!] [/!][text show=f]POP3_response=[tcpsend end=%0D%0A][/tcpsend][/text][!] ------------------------------------ ### 20. Proceed if server responded to POP3 connection request ### [/!][showif [url][POP3_response][/url]!][!] [/!][text show=f]timestamp=<[middle startafter=<&endbefore=>][POP3_response][/middle]>[/text][!] ------------------------------------ ### Set authorisation variable ### [/!][text]Authorization=PASSED[/text][!] ------------------------------------ ### Use normal USER/PASS combinaton for Gmail ### [/!][text show=f]USER_response=[tcpsend end=%0D%0A]USER [thisUser][UnURL]%0D%0A[/UnURL][/tcpsend][/text][!] [/!][showif [GetChars start=2&end=3][USER_response][/GetChars]!OK][text]Authorization=FAILED[/text][/showif][!] [/!][showif [GetChars start=2&end=3][USER_response][/GetChars]=OK][!] [/!][text show=f]PASS_response=[tcpsend end=%0D%0A]PASS [thisPass][UnURL]%0D%0A[/UnURL][/tcpsend][/text][!] [/!][showif [GetChars start=2&end=3][PASS_response][/GetChars]!OK][text]Authorization=FAILED[/text][/showif][!] [/!][/showif][!] [/!][showif [Authorization]=FAILED]Either user name or password is wrong![/showif][!] ------------------------------------ ### 30. Proceed if server responded OK to User / Pass ### [/!][showif [Authorization]=PASSED][!] [/!][text show=f]LIST_response=[tcpsend end=%0D%0A.%0D%0A]LIST[UnURL]%0D%0A[/UnURL][/tcpsend][/text][!] ------------------------------------ ### Delete email from server ### [/!][tcpsend end=%0D%0A]DELE [thisDownload][UnURL]%0D%0A[/UnURL][/tcpsend][!] [/!][/showif][!] ------------------------------------ ### Quit session ### [/!][tcpsend end=%0D%0A]QUIT[unurl]%0D%0A[/unurl][/tcpsend][!] [/!][/showif][!] ------------------------------------ ### 20. End showif ### [/!][!] ### Debug message ### [/!][showif [showDebug]=T]Message [thisDownload] deleted
[/showif][!] [/!][/tcpconnect][!] [/!][/showif] Complete --0022152d5f15d436ec04920dd85a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Olin,

Here you go - its basically a modified version of = the old Shared_POP3 code.

I'm using this for a= utomatic bounce management for a mailing list. =C2=A0 So I check for emails= that begin with 'bounce-' and only pull them down. =C2=A0You shoul= d be able to easily amend it for whatever needs you have though. =C2=A0=C2= =A0

If anyone can make it more efficient it would be great = to post the improvements back to the list.

- Tom





[!]<!-- HAS_WEBDNA_TAGS -->
[/!][!]



--------------------------------= ----
### = =C2=A0Restrict trigger to 5 minute intervals =C2=A0###

=
[/!][showif [time %M]\5][!]


----------= --------------------------

[/!][!]

### =C2=A0Debug message =C2=A0#= ##
[/!][showif [showDebug]=3DT]<h4>Connecting...</h4>
Conn= ecting host=3D[thisHost] port=3D[thisPort]<br />
Elapsed-time: [elap= sedtime] - Actual time: [time]<br />[/showif][!]


[/!][tcpconnect host=3D[thisHost]&po= rt=3D[thisPort]&ssl=3DT][!]
[/!][text show=3Df]POP3_response= =3D[tcpsend end=3D%0D%0A][/tcpsend][/text][!]

### =C2=A0Deb= ug message =C2=A0###
[/!]= [showif [showDebug]=3DT]POP3_Response=3D{[POP3_response]}<br />[/show= if][!]



---------------------= ---------------
### = =C2=A020. Proceed if server responded to POP3 connection request =C2=A0###<= /div>

[/!][showif [url][POP3_response][/url]!][!]
<= div>
[/!][text show=3Df]timestamp=3D<[middle startafter=3D<&endbe= fore=3D>][POP3_response][/middle]>[/text][!]



------------------------------------
### = =C2=A0Set authorisation variable =C2=A0###

[/!][te= xt]Authorization=3DPASSED[/text][!]



----------= --------------------------
### =C2=A0Use normal USER/PASS combinaton for = Gmail =C2=A0###

[/!][!]

### =C2=A0Debug message =C2=A0#= ##
[/!][showif [showDebug]=3DT]<h4>USER...[user]</h4>[/showif]= [!]


[/!][text show=3Df]USER_response=3D[tcps= end end=3D%0D%0A]USER [thisUser][UnURL]%0D%0A[/UnURL][/tcpsend][/text][!]

### =C2=A0Debug message =C2=A0###
[/!]= [showif [showDebug]=3DT]USER_response=3D{[USER_response]}<br />[/show= if][!]

[/!][showif [GetChars start=3D2&end=3D3= ][USER_response][/GetChars]!OK][text]Authorization=3DFAILED[/text][/showif]= [!]

[/!][showif [GetChars start=3D2&end=3D3][USER_respo= nse][/GetChars]=3DOK][!]

### =C2=A0Debug message =C2=A0###<= /div>
[/!][showif [showDebug]=3DT]<h4>PASS...</h4>[/showif][!]


[/!][text show=3Df]PASS_response=3D[tcps= end end=3D%0D%0A]PASS [thisPass][UnURL]%0D%0A[/UnURL][/tcpsend][/text][!]

### =C2=A0Debug message =C2=A0###
[/!]= [showif [showDebug]=3DT]PASS_response=3D{[PASS_response]}<br />[/show= if][!]

[/!][showif [GetChars start=3D2&end=3D3= ][PASS_response][/GetChars]!OK][text]Authorization=3DFAILED[/text][/showif]= [!]

[/!][/showif][!]


[/!][showif [Authorization]=3DFAILED]<strong>Either user name or pa= ssword is wrong!</strong>[/showif][!]



------------------------------------
### =C2=A030. Proceed= if server responded OK to User / Pass =C2=A0###

[/!][showif [Authorization]=3DPASSED][!]

=
### =C2=A0Debug message =C2=A0###
[/!][showif [showDebug]=3DT]<h4>= LIST...</h4>[/showif][!]

[/!][text show=3Df]LIST_response=3D[tcpsend end=3D%0D%0= A.%0D%0A]LIST[UnURL]%0D%0A[/UnURL][/tcpsend][/text][!]

=
### = =C2=A0Debug message =C2=A0###
[/!]= [showif [showDebug]=3DT]LIST_response=3D{[LIST_response]}<br />[/show= if][!]


------------------------------------
### = =C2=A0Get lists of emails with unique identifier =C2=A0###

[/!][text show=3Df]result=3D[middle startafter=3D%0D%0A&endbef= ore=3D.][LIST_response][/middle][/text][!]
[/!][listwords words=3D[result]&delimiters=3D %0D%0A][!]
[/!][showif [math][index]%2[/math]=3D1][text]curIndex=3D[word][/text][/sho= wif][!]
[/!][showif [math][index]%2[/math]=3D0][text]size[curInde= x]=3D[word][/text][/showif][!]
[/!][/listwords][!]

### =C2=A0Debug message =C2=A0###<= /div>
[/!][showif [showDebug]=3DT]<p>Elapsed time: [elapsedtime]</p>=
<= h4>UIDL...</h4>[/showif][!]



= ------------------------------------
### = =C2=A0Get the header of each email and only check where email begins with &= #39;bounce-' =C2=A0###

[/!][text show=3Df]resu= lt=3D[tcpsend end=3D%0D%0A.%0D%0A]UIDL[UnURL]%0D%0A[/UnURL][/tcpsend][/text= ][!]
[/!][text show=3Df]result=3D[middle startafter=3D%0D%0A&endbefore= =3D.][result][/middle][/text][!]
[/!][math show=3Df]numEmails=3D0= [/math][!]

[/!][listwords words=3D[result]&del= imiters=3D %0D%0A][hideif [index]>[math][downloadEmails]*2[/math]][!]

[/!][showif [math][index]%2[/math]=3D1][text]curIndex= =3D[word][/text][/showif][!]


[/!][s= howif [math][index]%2[/math]=3D0][!]
[/!][text show=3Df]header=3D[tcpsend = end=3D%0D%0A.%0D%0A]TOP [curIndex] 0[UnURL]%0D%0A[/UnURL][/tcpsend][/text][= !]
[/!]= [text show=3Df]bounce=3D[include file=3Dgetline.inc&find=3DDelivered-To= : &data=3D[url][header][/url]][/text][!]

### =C2=A0Debu= g message =C2=A0###
[/!]= [showif [showDebug]=3DT][bounce]<br />[/showif][!]

[/!][!]


------------------------------= ------
### = =C2=A040. Proceed if address contains 'bounce-' =C2=A0###

[/!][showif [bounce]~bounce-][!]

<= br>

------------------------------------
### =C2=A0Limit size of message d= ownload =C2=A0###

[/!][hideif [interpret][size[curIndex]][/interpret]>= [maxSize]][!]

[/!][math show=3Df]numEmails=3D[numE= mails]+1[/math][!]



----------= --------------------------
### = =C2=A0Retrieve Mail =C2=A0###

[/!][!]
### =C2=A0Debug message =C2=A0###
[/!]= [showif [showDebug]=3DT]<strong>RETR [curIndex] (size: [interpret][si= ze[curIndex]][/interpret]) ...</strong><br />
Message download= beginning (Elapsed-time: [elapsedtime])<br />[/showif][!]

[/!][text show=3Df]thisDownload=3D[curIndex][/text][!]<= /div>
[/!][text show=3Df]result=3D[tcpsend end=3D%0D%0A.%0D%0A]RETR [cu= rIndex][UnURL]%0D%0A[/UnURL][/tcpsend][/text][!]

<= br>
-----= -------------------------------
### =C2=A0Delete email from server =C2=A0##= #

[tcpsend end=3D%0D%0A]DELE [curIndex][UnURL]%0D%0A[/UnURL][/tcps= end][/!][!]

### =C2=A0Debug message =C2=A0###
<= span class=3D"Apple-tab-span" style=3D"white-space:pre">[/!][showi= f [showDebug]=3DT]Message downloaded - processing beginning (Elapsed-time: = [elapsedtime])<br />[/showif][!]

[/!][text]numChar=3D[countchars][middle startafter=3D%0= D%0A&endbefore=3D%0D%0A.%0D%0A][result][/middle][/countchars][/text][!]=

[/!][text show=3Df]body=3D[middle startafter=3D%0= D%0A%0D%0A&endbefore=3D%0D%0A.%0D%0A][result][/middle][/text][!]

[/!][text show=3Df]header=3D[getchars start=3D1&end= =3D[math][numChar]-[countchars][body][/countchars][/math]][middle startafte= r=3D%0D%0A&endbefore=3D%0D%0A.%0D%0A][result][/middle][/getchars][/text= ][!]

[/!][text show=3Df]theDate=3D[include file=3Dgetline.in= c&find=3DDate: &data=3D[url][header][/url]][/text][!]
[/!= ][text show=3Df]theStatus=3D[include file=3Dgetline.inc&find=3DStatus: = &data=3D[url][body][/url]][/text][!]
[/!][text show=3Df]theDcode=3D[include file=3Dgetline2.inc&find=3D= Diagnostic-Code: &data=3D[url][body][/url]][/text][!]


[/!]


ADD YOU= R OWN CODE HERE TO APPEND DATA ETC


[!]

[/!][/hidei= f][!]

### =C2=A0Debug message =C2=A0###
[/!][showif [showD= ebug]=3DT]Processing finished (Elapsed-time: [elapsedtime])<br />[/sh= owif][!]

[/!][/showif][!]



= ------------------------------------
### =C2=A040. End showif =C2=A0= ###

[/!][/showif][!]

[/!][/hideif]= [/listwords][!]

[/!][/showif][!]



------------------------------------
### = =C2=A030. End showif =C2=A0###

[/!][!]
<= br>
### =C2=A0Debug message =C2=A0###
[/!]= [showif [showDebug]=3DT]<h4>QUIT...</h4>[/showif][!]
=


------------------------------------
### = =C2=A0Quit session =C2=A0###

[/!][tcpsend end=3D%0= D%0A]QUIT[unurl]%0D%0A[/unurl][/tcpsend][!]

### =C2=A0Debug= message =C2=A0###
[/!]= [showif [showDebug]=3DT]<h2>[numEmails] Message(s) Retrieved</h2&g= t;<br>[/showif][!]

[/!][/showif][!]



------------------------------------
###= =C2=A020. End showif =C2=A0###

[/!][!]

### =C2=A0Debug message =C2=A0#= ##
[/!][showif [showDebug]=3DT][showif [url][POP3_response][/url]=3D]No Re= sponse from the POP3 server.[/showif][/showif][!]

[/!][/tcpconnect]


[/showif][!]

### =C2=A0Debug message =C2=A0###
[/!][sho= wif [showDebug]=3DT]Elapsed-time: [elapsedtime] =C2=A0Actual time: [time]&l= t;br />[/showif][!]

[/!][!]




------------------------------------
### =C2=A0Delete last mes= sage if script hangs =C2=A0###

[/!][showif [elapsedtime]>60000][showif [showDebug]= =3DT]Message [thisDownload] hanging<br />[/showif][!]

<= /div>
[/!][tcpconnect host=3D[thisHost]&port=3D[thisPort]&ssl= =3DT][!]
[/!][text show=3Df]POP3_response=3D[tcpsend end=3D%0D%0A][/tcpsend][/t= ext][!]


------------------------------------<= /div>
### =C2=A0= 20. Proceed if server responded to POP3 connection request =C2=A0###
<= div>
[/!][showif [url][POP3_response][/url]!][!]
[/!][text show=3Df]timestamp=3D<[middle startafter=3D<&endbefore= =3D>][POP3_response][/middle]>[/text][!]

------------------------------------
### = =C2=A0Set authorisation variable =C2=A0###

[/!][te= xt]Authorization=3DPASSED[/text][!]


---------= ---------------------------
### = =C2=A0Use normal USER/PASS combinaton for Gmail =C2=A0###

[/!][text show=3Df]USER_response=3D[tcpsend end=3D%0D%0A]USER [this= User][UnURL]%0D%0A[/UnURL][/tcpsend][/text][!]

[/!][showif [GetChars start=3D2&end=3D3][USER_respo= nse][/GetChars]!OK][text]Authorization=3DFAILED[/text][/showif][!]

[/!][showif [GetChars start=3D2&end=3D3][USER_response= ][/GetChars]=3DOK][!]

[/!][text show=3Df]PASS_response=3D[tcpsend end=3D%0D%0= A]PASS [thisPass][UnURL]%0D%0A[/UnURL][/tcpsend][/text][!]

[/!][showif [GetChars start=3D2&end=3D3][PASS_response][/GetCh= ars]!OK][text]Authorization=3DFAILED[/text][/showif][!]

[/!][/showif][!]

[/!][showif [= Authorization]=3DFAILED]<strong>Either user name or password is wrong= !</strong>[/showif][!]


----------------= --------------------
### = =C2=A030. Proceed if server responded OK to User / Pass =C2=A0###

[/!][showif [Authorization]=3DPASSED][!]

[/!][text show=3Df]LIST_response=3D[tcpsend end=3D%0D%0A.%0D%0A]LIST= [UnURL]%0D%0A[/UnURL][/tcpsend][/text][!]


------------------------------------
### =C2=A0Del= ete email from server =C2=A0###

[/!][tcpsend end=3D%0D%0A]DELE [thisDownload][UnURL]%0D= %0A[/UnURL][/tcpsend][!]

[/!][/showif][!]


------------------------------------
### = =C2=A0Quit session =C2=A0###

[/!][tcpsend end=3D%0= D%0A]QUIT[unurl]%0D%0A[/unurl][/tcpsend][!]

[/!][/= showif][!]


------------------------------------
### =C2=A020.= End showif =C2=A0###

[/!][!]

### =C2=A0Debug message =C2=A0#= ##
[/!][showif [showDebug]=3DT]Message [thisDownload] deleted<br />[= /showif][!]

[/!][/tcpconnect][!]

[/!][/sho= wif]

Complete
--0022152d5f15d436ec04920dd85a-- Associated Messages, from the most recent to the oldest:

    
  1. RE: [WebDNA] Script choking on POP download ("Olin Lagon" 2010)
  2. Re: [WebDNA] Script choking on POP download (Tom Duke 2010)
  3. Re: [WebDNA] Script choking on POP download (Tom Duke 2010)
  4. RE: [WebDNA] Script choking on POP download ("Olin Lagon" 2010)
  5. Re: [WebDNA] Script choking on POP download (Tom Duke 2010)
  6. Re: [WebDNA] Script choking on POP download (Govinda 2010)
  7. [WebDNA] Script choking on POP download (Tom Duke 2010)
--0022152d5f15d436ec04920dd85a Content-Type: text/plain; charset=UTF-8 Olin, Here you go - its basically a modified version of the old Shared_POP3 code. I'm using this for automatic bounce management for a mailing list. So I check for emails that begin with 'bounce-' and only pull them down. You should be able to easily amend it for whatever needs you have though. If anyone can make it more efficient it would be great to post the improvements back to the list. - Tom
[!] [/!][!] ------------------------------------ ### Restrict trigger to 5 minute intervals ### [/!][showif [time %M]\5][!] ------------------------------------ ### Set template variables ### [/!][text]thisHost=pop.gmail.com[/text][!] [/!][text]thisUser=your_gmail_or_google_apps_email_address[/text][!] [/!][text]thisPass=your_gmail_or_google_apps_password[/text][!] [/!][text]thisPort=995[/text][!] [/!][text]maxSize=200000[/text][!] [/!][math show=f]numEmails=0[/math][!] [/!][math show=f]downloadEmails=100[/math][!] [/!][text]showDebug=F[/text][!] ------------------------------------ ### Connect to host ### [/!][!] ### Debug message ### [/!][showif [showDebug]=T]

Connecting...

Connecting host=[thisHost] port=[thisPort]
Elapsed-time: [elapsedtime] - Actual time: [time]
[/showif][!] [/!][tcpconnect host=[thisHost]&port=[thisPort]&ssl=T][!] [/!][text show=f]POP3_response=[tcpsend end=%0D%0A][/tcpsend][/text][!] ### Debug message ### [/!][showif [showDebug]=T]POP3_Response={[POP3_response]}
[/showif][!] ------------------------------------ ### 20. Proceed if server responded to POP3 connection request ### [/!][showif [url][POP3_response][/url]!][!] [/!][text show=f]timestamp=<[middle startafter=<&endbefore=>][POP3_response][/middle]>[/text][!] ------------------------------------ ### Set authorisation variable ### [/!][text]Authorization=PASSED[/text][!] ------------------------------------ ### Use normal USER/PASS combinaton for Gmail ### [/!][!] ### Debug message ### [/!][showif [showDebug]=T]

USER...[user]

[/showif][!] [/!][text show=f]USER_response=[tcpsend end=%0D%0A]USER [thisUser][unurl]%0D%0A[/UnURL][/tcpsend][/text][!] ### Debug message ### [/!][showif [showDebug]=T]USER_response={[USER_response]}
[/showif][!] [/!][showif [GetChars start=2&end=3][USER_response][/GetChars]!OK][text]Authorization=FAILED[/text][/showif][!] [/!][showif [GetChars start=2&end=3][USER_response][/GetChars]=OK][!] ### Debug message ### [/!][showif [showDebug]=T]

PASS...

[/showif][!] [/!][text show=f]PASS_response=[tcpsend end=%0D%0A]PASS [thisPass][unurl]%0D%0A[/UnURL][/tcpsend][/text][!] ### Debug message ### [/!][showif [showDebug]=T]PASS_response={[PASS_response]}
[/showif][!] [/!][showif [GetChars start=2&end=3][PASS_response][/GetChars]!OK][text]Authorization=FAILED[/text][/showif][!] [/!][/showif][!] [/!][showif [Authorization]=FAILED]Either user name or password is wrong![/showif][!] ------------------------------------ ### 30. Proceed if server responded OK to User / Pass ### [/!][showif [Authorization]=PASSED][!] ### Debug message ### [/!][showif [showDebug]=T]

LIST...

[/showif][!] [/!][text show=f]LIST_response=[tcpsend end=%0D%0A.%0D%0A]LIST[unurl]%0D%0A[/UnURL][/tcpsend][/text][!] ### Debug message ### [/!][showif [showDebug]=T]LIST_response={[LIST_response]}
[/showif][!] ------------------------------------ ### Get lists of emails with unique identifier ### [/!][text show=f]result=[middle startafter=%0D%0A&endbefore=.][LIST_response][/middle][/text][!] [/!][listwords words=[result]&delimiters= %0D%0A][!] [/!][showif [math][index]%2[/math]=1][text]curIndex=[word][/text][/showif][!] [/!][showif [math][index]%2[/math]=0][text]size[curIndex]=[word][/text][/showif][!] [/!][/listwords][!] ### Debug message ### [/!][showif [showDebug]=T]

Elapsed time: [elapsedtime]

UIDL...

[/showif][!] ------------------------------------ ### Get the header of each email and only check where email begins with 'bounce-' ### [/!][text show=f]result=[tcpsend end=%0D%0A.%0D%0A]UIDL[unurl]%0D%0A[/UnURL][/tcpsend][/text][!] [/!][text show=f]result=[middle startafter=%0D%0A&endbefore=.][result][/middle][/text][!] [/!][math show=f]numEmails=0[/math][!] [/!][listwords words=[result]&delimiters= %0D%0A][hideif [index]>[math][downloadEmails]*2[/math]][!] [/!][showif [math][index]%2[/math]=1][text]curIndex=[word][/text][/showif][!] [/!][showif [math][index]%2[/math]=0][!] [/!][text show=f]header=[tcpsend end=%0D%0A.%0D%0A]TOP [curIndex] 0[unurl]%0D%0A[/UnURL][/tcpsend][/text][!] [/!][text show=f]bounce=[include file=getline.inc&find=Delivered-To: &data=[url][header][/url]][/text][!] ### Debug message ### [/!][showif [showDebug]=T][bounce]
[/showif][!] [/!][!] ------------------------------------ ### 40. Proceed if address contains 'bounce-' ### [/!][showif [bounce]~bounce-][!] ------------------------------------ ### Limit size of message download ### [/!][hideif [interpret][size[curIndex]][/interpret]>[maxSize]][!] [/!][math show=f]numEmails=[numEmails]+1[/math][!] ------------------------------------ ### Retrieve Mail ### [/!][!] ### Debug message ### [/!][showif [showDebug]=T]RETR [curIndex] (size: [interpret][size[curIndex]][/interpret]) ...
Message download beginning (Elapsed-time: [elapsedtime])
[/showif][!] [/!][text show=f]thisDownload=[curIndex][/text][!] [/!][text show=f]result=[tcpsend end=%0D%0A.%0D%0A]RETR [curIndex][unurl]%0D%0A[/UnURL][/tcpsend][/text][!] ------------------------------------ ### Delete email from server ### [tcpsend end=%0D%0A]DELE [curIndex][unurl]%0D%0A[/UnURL][/tcpsend][/!][!] ### Debug message ### [/!][showif [showDebug]=T]Message downloaded - processing beginning (Elapsed-time: [elapsedtime])
[/showif][!] [/!][text]numChar=[countchars][middle startafter=%0D%0A&endbefore=%0D%0A.%0D%0A][result][/middle][/countchars][/text][!] [/!][text show=f]body=[middle startafter=%0D%0A%0D%0A&endbefore=%0D%0A.%0D%0A][result][/middle][/text][!] [/!][text show=f]header=[getchars start=1&end=[math][numChar]-[countchars][body][/countchars][/math]][middle startafter=%0D%0A&endbefore=%0D%0A.%0D%0A][result][/middle][/getchars][/text][!] [/!][text show=f]theDate=[include file=getline.inc&find=Date: &data=[url][header][/url]][/text][!] [/!][text show=f]theStatus=[include file=getline.inc&find=Status: &data=[url][body][/url]][/text][!] [/!][text show=f]theDcode=[include file=getline2.inc&find=Diagnostic-Code: &data=[url][body][/url]][/text][!] [/!] ADD YOUR OWN CODE HERE TO APPEND DATA ETC [!] [/!][/hideif][!] ### Debug message ### [/!][showif [showDebug]=T]Processing finished (Elapsed-time: [elapsedtime])
[/showif][!] [/!][/showif][!] ------------------------------------ ### 40. End showif ### [/!][/showif][!] [/!][/hideif][/listwords][!] [/!][/showif][!] ------------------------------------ ### 30. End showif ### [/!][!] ### Debug message ### [/!][showif [showDebug]=T]

QUIT...

[/showif][!] ------------------------------------ ### Quit session ### [/!][tcpsend end=%0D%0A]QUIT[unurl]%0D%0A[/unurl][/tcpsend][!] ### Debug message ### [/!][showif [showDebug]=T]

[numEmails] Message(s) Retrieved


[/showif][!] [/!][/showif][!] ------------------------------------ ### 20. End showif ### [/!][!] ### Debug message ### [/!][showif [showDebug]=T][showif [url][POP3_response][/url]=]No Response from the POP3 server.[/showif][/showif][!] [/!][/tcpconnect] [/showif][!] ### Debug message ### [/!][showif [showDebug]=T]Elapsed-time: [elapsedtime] Actual time: [time]
[/showif][!] [/!][!] ------------------------------------ ### Delete last message if script hangs ### [/!][showif [elapsedtime]>60000][showif [showDebug]=T]Message [thisDownload] hanging
[/showif][!] [/!][tcpconnect host=[thisHost]&port=[thisPort]&ssl=T][!] [/!][text show=f]POP3_response=[tcpsend end=%0D%0A][/tcpsend][/text][!] ------------------------------------ ### 20. Proceed if server responded to POP3 connection request ### [/!][showif [url][POP3_response][/url]!][!] [/!][text show=f]timestamp=<[middle startafter=<&endbefore=>][POP3_response][/middle]>[/text][!] ------------------------------------ ### Set authorisation variable ### [/!][text]Authorization=PASSED[/text][!] ------------------------------------ ### Use normal USER/PASS combinaton for Gmail ### [/!][text show=f]USER_response=[tcpsend end=%0D%0A]USER [thisUser][unurl]%0D%0A[/UnURL][/tcpsend][/text][!] [/!][showif [GetChars start=2&end=3][USER_response][/GetChars]!OK][text]Authorization=FAILED[/text][/showif][!] [/!][showif [GetChars start=2&end=3][USER_response][/GetChars]=OK][!] [/!][text show=f]PASS_response=[tcpsend end=%0D%0A]PASS [thisPass][unurl]%0D%0A[/UnURL][/tcpsend][/text][!] [/!][showif [GetChars start=2&end=3][PASS_response][/GetChars]!OK][text]Authorization=FAILED[/text][/showif][!] [/!][/showif][!] [/!][showif [Authorization]=FAILED]Either user name or password is wrong![/showif][!] ------------------------------------ ### 30. Proceed if server responded OK to User / Pass ### [/!][showif [Authorization]=PASSED][!] [/!][text show=f]LIST_response=[tcpsend end=%0D%0A.%0D%0A]LIST[unurl]%0D%0A[/UnURL][/tcpsend][/text][!] ------------------------------------ ### Delete email from server ### [/!][tcpsend end=%0D%0A]DELE [thisDownload][unurl]%0D%0A[/UnURL][/tcpsend][!] [/!][/showif][!] ------------------------------------ ### Quit session ### [/!][tcpsend end=%0D%0A]QUIT[unurl]%0D%0A[/unurl][/tcpsend][!] [/!][/showif][!] ------------------------------------ ### 20. End showif ### [/!][!] ### Debug message ### [/!][showif [showDebug]=T]Message [thisDownload] deleted
[/showif][!] [/!][/tcpconnect][!] [/!][/showif] Complete --0022152d5f15d436ec04920dd85a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Olin,

Here you go - its basically a modified version of = the old Shared_POP3 code.

I'm using this for a= utomatic bounce management for a mailing list. =C2=A0 So I check for emails= that begin with 'bounce-' and only pull them down. =C2=A0You shoul= d be able to easily amend it for whatever needs you have though. =C2=A0=C2= =A0

If anyone can make it more efficient it would be great = to post the improvements back to the list.

- Tom





[!]<!-- HAS_WEBDNA_TAGS -->
[/!][!]



--------------------------------= ----
### = =C2=A0Restrict trigger to 5 minute intervals =C2=A0###

=
[/!][showif [time %M]\5][!]


----------= --------------------------
### =C2=A0Set template variables =C2=A0###

[/!][text]thisUser=3Dyour_gmail_or_google_apps_email_= address[/text][!]
[/!][text]thisPass=3Dyour_gmail_or_google_apps_= password[/text][!]

[/!][text]thisPort=3D995[/text][!]
[/!][text]= maxSize=3D200000[/text][!]
[/!][math show=3Df]numEmails=3D0[/math= ][!]
[/!][math show=3Df]downloadEmails=3D100[/math][!]
=
[/!][text]showDebug=3DF[/text][!]


<= div>
------------------------------------
### =C2=A0Connect to host =C2= =A0###

[/!][!]

### =C2=A0Debug message =C2=A0#= ##
[/!][showif [showDebug]=3DT]<h4>Connecting...</h4>
Conn= ecting host=3D[thisHost] port=3D[thisPort]<br />
Elapsed-time: [elap= sedtime] - Actual time: [time]<br />[/showif][!]


[/!][tcpconnect host=3D[thisHost]&po= rt=3D[thisPort]&ssl=3DT][!]
[/!][text show=3Df]POP3_response= =3D[tcpsend end=3D%0D%0A][/tcpsend][/text][!]

### =C2=A0Deb= ug message =C2=A0###
[/!]= [showif [showDebug]=3DT]POP3_Response=3D{[POP3_response]}<br />[/show= if][!]



---------------------= ---------------
### = =C2=A020. Proceed if server responded to POP3 connection request =C2=A0###<= /div>

[/!][showif [url][POP3_response][/url]!][!]
<= div>
[/!][text show=3Df]timestamp=3D<[middle startafter=3D<&endbe= fore=3D>][POP3_response][/middle]>[/text][!]



------------------------------------
### = =C2=A0Set authorisation variable =C2=A0###

[/!][te= xt]Authorization=3DPASSED[/text][!]



----------= --------------------------
### =C2=A0Use normal USER/PASS combinaton for = Gmail =C2=A0###

[/!][!]

### =C2=A0Debug message =C2=A0#= ##
[/!][showif [showDebug]=3DT]<h4>USER...[user]</h4>[/showif]= [!]


[/!][text show=3Df]USER_response=3D[tcps= end end=3D%0D%0A]USER [thisUser][unurl]%0D%0A[/UnURL][/tcpsend][/text][!]

### =C2=A0Debug message =C2=A0###
[/!]= [showif [showDebug]=3DT]USER_response=3D{[USER_response]}<br />[/show= if][!]

[/!][showif [GetChars start=3D2&end=3D3= ][USER_response][/GetChars]!OK][text]Authorization=3DFAILED[/text][/showif]= [!]

[/!][showif [GetChars start=3D2&end=3D3][USER_respo= nse][/GetChars]=3DOK][!]

### =C2=A0Debug message =C2=A0###<= /div>
[/!][showif [showDebug]=3DT]<h4>PASS...</h4>[/showif][!]


[/!][text show=3Df]PASS_response=3D[tcps= end end=3D%0D%0A]PASS [thisPass][unurl]%0D%0A[/UnURL][/tcpsend][/text][!]

### =C2=A0Debug message =C2=A0###
[/!]= [showif [showDebug]=3DT]PASS_response=3D{[PASS_response]}<br />[/show= if][!]

[/!][showif [GetChars start=3D2&end=3D3= ][PASS_response][/GetChars]!OK][text]Authorization=3DFAILED[/text][/showif]= [!]

[/!][/showif][!]


[/!][showif [Authorization]=3DFAILED]<strong>Either user name or pa= ssword is wrong!</strong>[/showif][!]



------------------------------------
### =C2=A030. Proceed= if server responded OK to User / Pass =C2=A0###

[/!][showif [Authorization]=3DPASSED][!]

=
### =C2=A0Debug message =C2=A0###
[/!][showif [showDebug]=3DT]<h4>= LIST...</h4>[/showif][!]

[/!][text show=3Df]LIST_response=3D[tcpsend end=3D%0D%0= A.%0D%0A]LIST[unurl]%0D%0A[/UnURL][/tcpsend][/text][!]

=
### = =C2=A0Debug message =C2=A0###
[/!]= [showif [showDebug]=3DT]LIST_response=3D{[LIST_response]}<br />[/show= if][!]


------------------------------------
### = =C2=A0Get lists of emails with unique identifier =C2=A0###

[/!][text show=3Df]result=3D[middle startafter=3D%0D%0A&endbef= ore=3D.][LIST_response][/middle][/text][!]
[/!][listwords words=3D[result]&delimiters=3D %0D%0A][!]
[/!][showif [math][index]%2[/math]=3D1][text]curIndex=3D[word][/text][/sho= wif][!]
[/!][showif [math][index]%2[/math]=3D0][text]size[curInde= x]=3D[word][/text][/showif][!]
[/!][/listwords][!]

### =C2=A0Debug message =C2=A0###<= /div>
[/!][showif [showDebug]=3DT]<p>Elapsed time: [elapsedtime]</p>=
<= h4>UIDL...</h4>[/showif][!]



= ------------------------------------
### = =C2=A0Get the header of each email and only check where email begins with &= #39;bounce-' =C2=A0###

[/!][text show=3Df]resu= lt=3D[tcpsend end=3D%0D%0A.%0D%0A]UIDL[unurl]%0D%0A[/UnURL][/tcpsend][/text= ][!]
[/!][text show=3Df]result=3D[middle startafter=3D%0D%0A&endbefore= =3D.][result][/middle][/text][!]
[/!][math show=3Df]numEmails=3D0= [/math][!]

[/!][listwords words=3D[result]&del= imiters=3D %0D%0A][hideif [index]>[math][downloadEmails]*2[/math]][!]

[/!][showif [math][index]%2[/math]=3D1][text]curIndex= =3D[word][/text][/showif][!]


[/!][s= howif [math][index]%2[/math]=3D0][!]
[/!][text show=3Df]header=3D[tcpsend = end=3D%0D%0A.%0D%0A]TOP [curIndex] 0[unurl]%0D%0A[/UnURL][/tcpsend][/text][= !]
[/!]= [text show=3Df]bounce=3D[include file=3Dgetline.inc&find=3DDelivered-To= : &data=3D[url][header][/url]][/text][!]

### =C2=A0Debu= g message =C2=A0###
[/!]= [showif [showDebug]=3DT][bounce]<br />[/showif][!]

[/!][!]


------------------------------= ------
### = =C2=A040. Proceed if address contains 'bounce-' =C2=A0###

[/!][showif [bounce]~bounce-][!]

<= br>

------------------------------------
### =C2=A0Limit size of message d= ownload =C2=A0###

[/!][hideif [interpret][size[curIndex]][/interpret]>= [maxSize]][!]

[/!][math show=3Df]numEmails=3D[numE= mails]+1[/math][!]



----------= --------------------------
### = =C2=A0Retrieve Mail =C2=A0###

[/!][!]
### =C2=A0Debug message =C2=A0###
[/!]= [showif [showDebug]=3DT]<strong>RETR [curIndex] (size: [interpret][si= ze[curIndex]][/interpret]) ...</strong><br />
Message download= beginning (Elapsed-time: [elapsedtime])<br />[/showif][!]

[/!][text show=3Df]thisDownload=3D[curIndex][/text][!]<= /div>
[/!][text show=3Df]result=3D[tcpsend end=3D%0D%0A.%0D%0A]RETR [cu= rIndex][unurl]%0D%0A[/UnURL][/tcpsend][/text][!]

<= br>
-----= -------------------------------
### =C2=A0Delete email from server =C2=A0##= #

[tcpsend end=3D%0D%0A]DELE [curIndex][unurl]%0D%0A[/UnURL][/tcps= end][/!][!]

### =C2=A0Debug message =C2=A0###
<= span class=3D"Apple-tab-span" style=3D"white-space:pre">[/!][showi= f [showDebug]=3DT]Message downloaded - processing beginning (Elapsed-time: = [elapsedtime])<br />[/showif][!]

[/!][text]numChar=3D[countchars][middle startafter=3D%0= D%0A&endbefore=3D%0D%0A.%0D%0A][result][/middle][/countchars][/text][!]=

[/!][text show=3Df]body=3D[middle startafter=3D%0= D%0A%0D%0A&endbefore=3D%0D%0A.%0D%0A][result][/middle][/text][!]

[/!][text show=3Df]header=3D[getchars start=3D1&end= =3D[math][numChar]-[countchars][body][/countchars][/math]][middle startafte= r=3D%0D%0A&endbefore=3D%0D%0A.%0D%0A][result][/middle][/getchars][/text= ][!]

[/!][text show=3Df]theDate=3D[include file=3Dgetline.in= c&find=3DDate: &data=3D[url][header][/url]][/text][!]
[/!= ][text show=3Df]theStatus=3D[include file=3Dgetline.inc&find=3DStatus: = &data=3D[url][body][/url]][/text][!]
[/!][text show=3Df]theDcode=3D[include file=3Dgetline2.inc&find=3D= Diagnostic-Code: &data=3D[url][body][/url]][/text][!]


[/!]


ADD YOU= R OWN CODE HERE TO APPEND DATA ETC



[/!][/hidei= f][!]

### =C2=A0Debug message =C2=A0###
[/!][showif [showD= ebug]=3DT]Processing finished (Elapsed-time: [elapsedtime])<br />[/sh= owif][!]

[/!][/showif][!]



= ------------------------------------
### =C2=A040. End showif =C2=A0= ###

[/!][/showif][!]

[/!][/hideif]= [/listwords][!]

[/!][/showif][!]



------------------------------------
### = =C2=A030. End showif =C2=A0###

[/!][!]
<= br>
### =C2=A0Debug message =C2=A0###
[/!]= [showif [showDebug]=3DT]<h4>QUIT...</h4>[/showif][!]
=


------------------------------------
### = =C2=A0Quit session =C2=A0###

[/!][tcpsend end=3D%0= D%0A]QUIT[unurl]%0D%0A[/unurl][/tcpsend][!]

### =C2=A0Debug= message =C2=A0###
[/!]= [showif [showDebug]=3DT]<h2>[numEmails] Message(s) Retrieved</h2&g= t;<br>[/showif][!]

[/!][/showif][!]



------------------------------------
###= =C2=A020. End showif =C2=A0###

[/!][!]

### =C2=A0Debug message =C2=A0#= ##
[/!][showif [showDebug]=3DT][showif [url][POP3_response][/url]=3D]No Re= sponse from the POP3 server.[/showif][/showif][!]

[/!][/tcpconnect]


[/showif][!]

### =C2=A0Debug message =C2=A0###
[/!][sho= wif [showDebug]=3DT]Elapsed-time: [elapsedtime] =C2=A0Actual time: [time]&l= t;br />[/showif][!]

[/!][!]




------------------------------------
### =C2=A0Delete last mes= sage if script hangs =C2=A0###

[/!][showif [elapsedtime]>60000][showif [showDebug]= =3DT]Message [thisDownload] hanging<br />[/showif][!]

<= /div>
[/!][tcpconnect host=3D[thisHost]&port=3D[thisPort]&ssl= =3DT][!]
[/!][text show=3Df]POP3_response=3D[tcpsend end=3D%0D%0A][/tcpsend][/t= ext][!]


------------------------------------<= /div>
### =C2=A0= 20. Proceed if server responded to POP3 connection request =C2=A0###
<= div>
[/!][showif [url][POP3_response][/url]!][!]
[/!][text show=3Df]timestamp=3D<[middle startafter=3D<&endbefore= =3D>][POP3_response][/middle]>[/text][!]

------------------------------------
### = =C2=A0Set authorisation variable =C2=A0###

[/!][te= xt]Authorization=3DPASSED[/text][!]


---------= ---------------------------
### = =C2=A0Use normal USER/PASS combinaton for Gmail =C2=A0###

[/!][text show=3Df]USER_response=3D[tcpsend end=3D%0D%0A]USER [this= User][unurl]%0D%0A[/UnURL][/tcpsend][/text][!]

[/!][showif [GetChars start=3D2&end=3D3][USER_respo= nse][/GetChars]!OK][text]Authorization=3DFAILED[/text][/showif][!]

[/!][showif [GetChars start=3D2&end=3D3][USER_response= ][/GetChars]=3DOK][!]

[/!][text show=3Df]PASS_response=3D[tcpsend end=3D%0D%0= A]PASS [thisPass][unurl]%0D%0A[/UnURL][/tcpsend][/text][!]

[/!][showif [GetChars start=3D2&end=3D3][PASS_response][/GetCh= ars]!OK][text]Authorization=3DFAILED[/text][/showif][!]

[/!][/showif][!]

[/!][showif [= Authorization]=3DFAILED]<strong>Either user name or password is wrong= !</strong>[/showif][!]


----------------= --------------------
### = =C2=A030. Proceed if server responded OK to User / Pass =C2=A0###

[/!][showif [Authorization]=3DPASSED][!]

[/!][text show=3Df]LIST_response=3D[tcpsend end=3D%0D%0A.%0D%0A]LIST= [unurl]%0D%0A[/UnURL][/tcpsend][/text][!]


------------------------------------
### =C2=A0Del= ete email from server =C2=A0###

[/!][tcpsend end=3D%0D%0A]DELE [thisDownload][unurl]%0D= %0A[/UnURL][/tcpsend][!]

[/!][/showif][!]


------------------------------------
### = =C2=A0Quit session =C2=A0###

[/!][tcpsend end=3D%0= D%0A]QUIT[unurl]%0D%0A[/unurl][/tcpsend][!]

[/!][/= showif][!]


------------------------------------
### =C2=A020.= End showif =C2=A0###

[/!][!]

### =C2=A0Debug message =C2=A0#= ##
[/!][showif [showDebug]=3DT]Message [thisDownload] deleted<br />[= /showif][!]

[/!][/tcpconnect][!]

[/!][/sho= wif]

Complete
--0022152d5f15d436ec04920dd85a-- Tom Duke

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

[WebDNA] Best of breed eCommerce and CMS/Sitebuilder templates (2010) SQL statements (2002) First postarg not taking in $Commands (1997) cookies ok ??? (2006) Show shoppingcart after remove last item (1997) New index for docs (1997) Re[2]: searches with dash, period etc. (back form politenes (2000) Virtual hosting and webcatNT (1997) Errata: WCS Newbie question (1997) Createfolder OSX WC3.08 (2001) Making webcam movies (2003) Error after loading WebDNA (2004) What am I missing (1997) Emailer again & again (1997) cart (1997) Code database (1998) (1997) Lot entry (1999) WebDNA Feature Request (2006) WebCat2: Items xx to xx shown, etc. (1997)