2
Increase in IMAP latency on version 8223.
Question asked by Eric Tykwinski - 8/5/2022 at 6:16 AM
Unanswered
This isn't a deal breaker, but I've notice an increase in latency from our outside monitoring since the upgrade to 8223.  We went from around 30 msec latency to an average of about 270 msec.  Traffic counters on SmarterMail are pretty much the same, so the only change I can see is the version upgrade. I'm monitoring StartTLS on port 143 for the server.  It seems like Explicit SSL on port 993 isn't effected.

10 Replies

Reply to Thread
1
Employee Replied
Employee Post
Hi Eric, 

Build 8251 (Aug 4, 2022) is our latest version. Would you please see if this new release has any impact on the IMAP latency? If you find the same averages, I'd encourage you to submit a ticket to the Support Department so they can help you to review this more. 

Kind regards,
0
Michael Replied
Very interesting... We use a 3rd party app that is integrated over IMAP (missiveapp.com). When we search IMAP messages in their app we get error "server is too slow to search full body"

So maybe latency issues as you're mentioning?
0
Michael Replied
Here's what Missiveapp is telling us about IMAP and search latency...

Long story short, search is challenging for generic IMAP accounts. It’s probably not the answer you were hoping for, but hopefully it gives you a good idea of the challenges we are facing and the tradeoffs we must make as a small company who wants to provide a feature-rich application that‘s also cost-effective (both for us and our customers).
 
An IMAP extension we know that can significantly improve search is SEARCH=FUZZY:
 
 
Unfortunately few independent email providers support it, at least by default. Some providers run installations of Dovecot that support SEARCH=FUZZY but those are rare. Dovecot is the most popular IMAP software. It supports SEARCH=FUZZY since version 2.1, but the extension must be manually enabled:
 
 
These links are the relevant documentation pages you could send to your hosting provider as reference.
4
Zach Sylvester Replied
Employee Post
Hello Everyone, 

I did some testing with Missiveapp and found some interesting results. 
If you turn off IMAP IDLE in Settings->Protocols the warning goes away. 
Not too sure why this is increasing the latency. But ill do some testing and see what I find. 

Kind Regards, 
Zach Sylvester Software Developer SmarterTools Inc. www.smartertools.com
0
Zach Sylvester Replied
Employee Post
Hello Everyone, 

Just an update I'm not seeing an increase in latency when compared to 8125 it also seems like having IDLE turned off makes the IMAP response about 1 MS slower from my testing. 
Please test your server with this python script. This script gets the avg execution time for 100 searches on a given host and account. You will just need to install python 3 and edit the placeholder info. 
import imaplib
import pprint
import timeit

imap_host = 'mail.example.com'
imap_user = 'email@email.com'
imap_pass = 'password for email'

    # connect to host using SSL
imap = imaplib.IMAP4_SSL(imap_host)
imap.login(imap_user, imap_pass)

def imapconnection():

   

    imap.select('Inbox')

    tmp, data = imap.search(None,'FROM' , 'emailtosearchfor@gmail.com')
    for num in data[0].split():
        tmp, data = imap.fetch(num, '(RFC822)')
        #print('Message: {0}\n'.format(num))
        #pprint.pprint(data[0][1])
        break
  

#save the execution time to a list
execution_time_list = []
i = 0
while i < 100:
    execution_time = timeit.timeit(imapconnection, number=1)
    execution_time_list.append(execution_time)
    i += 1


#print the average execution time from the list
print(sum(execution_time_list)/len(execution_time_list))

imap.close()
Looking forward to hearing your results. So far this looks like it might be an issue with missiveapp.com's IMAP IDLE compatibility. 

Kind Regards, 
Zach Sylvester Software Developer SmarterTools Inc. www.smartertools.com
1
Eric Tykwinski Replied
Zach,

Compare the difference between:
imap = imaplib.IMAP4_SSL(imap_host)
and
imap = imaplib.IMAP4(imap_host)
imap.starttls()
That's what my outside monitoring was seeing the difference in.  I wasn't even searching, just doing a starttls command and login.
0
Zach Sylvester Replied
Employee Post
Hello, 

Thanks for the follow-up. I got it to connect. By default, TLS uses port 143 so you will want to make sure that port/binding is open. This is my avg with SSL 0.2812195390010311 MS and with TLS 0.27516979199965136 MS with IDLE turned on or off I don't see a difference outside of the margin of error.  I tested this with 8125 and the results are the same there. 

Kind regards, 

Zach Sylvester Software Developer SmarterTools Inc. www.smartertools.com
0
Michael Replied
Zach,

Maybe separate issue why searching fails using Missive over IMAP?
0
Michael Replied
Zach,

In Missive, I find that IMAP search always fails to search body, but the fallback search (searching only From / To / Cc / Subject) only works maybe 50% of the time. It's as if some searches get high latency and some return more quickly?
0
Michael Replied
Zach Sylvester we're wondering if any movement about the idea that Smarter Mail could run Dovecot or similar tool that supports SEARCH=FUZZY

Reply to Thread