IMAP Search skipping results

Bob Sneidar bobsneidar at iotecdigital.com
Fri Mar 20 11:06:51 EDT 2020


This may be of more use. No functional changes, just something you can use to test against different IMAP servers:

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
   catch tError
      answer error "ERROR: Unable to initialize TSNet" as sheet
      breakpoint
   end try
   
   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
   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 07:26 , Pi Digital via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Thanks Matthias
> 
> I will give it a go. I tried some of the other settings but not that one as it happens. Does that not upset the fact that you have set the inbox and also download each message body one at a time? That’s why I didn’t try it. 
> 
> In fact, just gave it a go but by the time the second call is requested it fails with the response that ‘No Mailbox Selected’ so logs out again. I tried putting the setting between the two calls. Same issue. 
> 
> There are 1639 messages on the server but only 110 seem to show even with ‘UID SEARCH ALL’. 
> 
> Sean Cole
> 



More information about the use-livecode mailing list