Thanks Bob

Yeah, I actually already have something like that. I’d abbreviated my code to 
keep it simple on the forum. I’m not having trouble connecting. It’s just the 
shortage of data returned from the server. It’s actually skipping a whole chunk 
in the middle which is the weirdest part. 

There is this bug which is yet to be followed up on. 

https://quality.livecode.com/show_bug.cgi?id=22216

So I look forward to that in a couple of years maybe. 

In the meantime I’m hoping I find a solution to this or else it’s yet another 
reason for clients to disappear saying “you can’t even do so and so”. It gets 
so tedious having all the workarounds on workarounds. 

Sean Cole
Pi Digital

> On 20 Mar 2020, at 15:10, Bob Sneidar via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
> This version wraps ALL the tsNet calls in a try catch construct:
> 
> function IMAPGetHeaders pServer, pUser, pPass
>   if pServer is empty then
>      ask "Enter IMAP Server IP or address:" as sheet
>      if the result is "Cancel" then return "Canceled."
>      put it into pServer
>   end if
> 
>   if pUser is empty then
>      ask "Enter email address:" as sheet
>      if the result is "Cancel" then return "Canceled."
>      put it into pUser
>   end if
> 
>   if pPass is empty then
>      ask password "Enter password:" as sheet
>      if the result is "Cancel" then return "Canceled."
>      put it into pPass
>   end if
> 
>   put pUser into tSettings["username"]
>   put pPass into tSettings["password"]
>   put empty into xHeaders
> 
>   try
>      tsnetinit
>      put tsNetCustomSync(pServer, \
>            "SELECT INBOX",xHeaders,retHeaders,retResult, \
>            retBytes,tSettings) into tStat
>      put tsNetCustomSync(pServer, \
>            "UID SEARCH NOT SEEN",xHeaders,retHeaders, \
>            retResult,retBytes,tSettings) into tStat
>   catch tError
>      answer error "ERROR: " & tError as sheet
>      breakpoint
>   end try
> 
>   put word 3 to -1 of tStat into tUIDs
>   put the number of words in tUIDs into sMsgCount
>   return retHeaders &cr& tStat &cr& sMsgCount
> end IMAPGetHeaders
> 
>> On Mar 20, 2020, at 08:06 , Bob Sneidar via use-livecode 
>> <use-livecode@lists.runrev.com> wrote:
>> 
>> This may be of more use. No functional changes, just something you can use 
>> to test against different IMAP servers:
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to