SMTP connect takes minutes with many IMAP accounts

User Help for Mozilla Thunderbird
Post Reply
gregorrebel
New Member
Posts: 1
Joined: November 8th, 2017, 3:16 am

SMTP connect takes minutes with many IMAP accounts

Post by gregorrebel »

My TB manages 47 IMAP accounts being served on my own server.
The amount of accounts has grown over the last four months.
Since its been >30 IMAP accounts, TB takes very long to connect to my SMTP server when sending out a new email.

This is what happens:
1) I write a new email
2) I click on "Send"
3) The busy pointer spins
4) CPU time of process thunderbird reaches ~40%
5) Mail is sent after 4 minutes

When I write a second mail on the same IMAP account, it is send immediately.
I suggest that there is an internal limit of cached SMTP connections.
How to increase it?


Gregor
ccbrundage
Posts: 3
Joined: November 8th, 2017, 6:40 am

Re: SMTP connect takes minutes with many IMAP accounts

Post by ccbrundage »

Same here. What seems to work for now is cancelling Send, try again, sometimes a third time, and then it goes through. But it is annoying.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: SMTP connect takes minutes with many IMAP accounts

Post by tanstaafl »

http://kb.mozillazine.org/Limits_-_Thunderbird

Try temporarily running in safe mode via help -> restart with add-ons disabled to rule out it being a side effect of an add-on that doesn't work well with the latest version of Thunderbird.

The problems with the SMTP server shouldn't depend upon whether or not you use a POP or IMAP account, unless its a delay caused by saving a copy of the sent message in a remote folder, or the same server is used for both IMAP and SMTP. See if temporarily using a sent folder in "local folders" makes a difference. Log into Cpanel or whatever you use to admin your server and see if you have any per node, per user or global connection limits that it might be running into.

See http://kb.mozillazine.org/Session_logging_for_mail/news if you want to enable SMTP logging.
yuriy.kb
Posts: 3
Joined: January 15th, 2018, 5:17 am

Re: SMTP connect takes minutes with many IMAP accounts

Post by yuriy.kb »

Faced a similar problem.
Thunderbird is installed on a terminal server running Windows Server 2012 Std. The program is used by 10 people.
It is connected from 3 to 4 accounts under the protocol imap. Server is being used (imap \ smtp) yandex.ru.

Immediately after sending the message Thunderbird "freezes" for 1.5 minutes, and the letter is sent and, often, already delivered to the recipient, ie. The problem is not with the mail provider.
The problem is observed for all users.

Thunderbird version 52.5.2. (Running thunderbird in safe mode, the problem remained).
The proxy server is not used.
Antivirus program - Kaspersky Small Office Security 4 File Server 15.0.2.361 (I disabled the antivirus completely, the problem remained).
Here's what I collected using Process Monitor: http://ipic.su/img/img7/fs/ProcessMonit ... 022838.jpg
This is part of the logs collected by the program itself: https://yadi.sk/i/o__g0AIm3RUFoN

Pay attention to the lines:
2018-01-15 11:40:40.090000 UTC - 49372[d182b00]: 141e4000:imap.yandex.ru:S-&BCMENAQwBDsENQQ9BD0ESwQ1-:CreateNewLineFromSocket: 6 OK UID fetch Completed.2018-01-15 11:42:12.616000 UTC - 1408[1012140]: proposed url = Archives folder for connection &BCMENAQwBDsENQQ9BD0ESwQ1- has To Wait = FALSE can run = FALSE
2018-01-15 11:42:12.618000 UTC - 49372[d182b00]: 141e4000:imap.yandex.ru:S-&BCMENAQwBDsENQQ9BD0ESwQ1-:ProcessCurrentURL: entering
This is the "freezes".

Please HELP!!! I have been struggling with this problem for 3 weeks already :'(
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: SMTP connect takes minutes with many IMAP accounts

Post by tanstaafl »

There have been very few threads about problems while running Thunderbird on terminal servers. That makes it tough to gain experience on what type of unique problems they run into.

See if http://kb.mozillazine.org/Performance_-_Thunderbird gives you anything worth investigating. Does this problem only occur when sending , or is that just when its most noticeable?

I suggest you try to duplicate the problem using a laptop/PC using a copy of the same profile, while using the same antivirus program. If you can duplicate the problem that way, then we would at least know its not a terminal server unique problem. Problems trying to duplicate the problem on a laptop/PC would also help rule out it being due to your ISP, your router etc. (stuff you have in common due to using the same location).
yuriy.kb
Posts: 3
Joined: January 15th, 2018, 5:17 am

Re: SMTP connect takes minutes with many IMAP accounts

Post by yuriy.kb »

Thanks for the advice, but I already tried to copy the profile, on the server with the new user, and on another PC.
http://kb.mozillazine.org/Performance_-_Thunderbird already re-read 2 times.

By the above error, I can add that sometimes emails are sent and thunderbird continues to work fine, without "freezes".

Based on the Process Monitor entries, the delay is associated with the file C:\Users\%username%\AppData\Local\Temp\%random_number%\nsemail.eml (nsemail-1.eml)
The operations "SetDispositionInformationFile" and the "CloseFile" following it take from 60 to 90 seconds.
But thunderbird itself writes differently.

Can someone help with the analysis of logs?
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: SMTP connect takes minutes with many IMAP accounts

Post by tanstaafl »

I already looked at the one page excerpt of the IMAP log file. There was nothing useful that I could spot. It might have helped if it was a complete log file, where you let any existing connections time out before running Thunderbird. You could have edited it to replace any email addresses with a obvious generic.

Is the delay with nsemail.eml due to something else locking the file? Think about temporarily uninstalling Kaspersky, not just disabling the anti-virus scanner, to see if its causing a problem. Its not unusual for a "disabled" anti-virus scanner to still effect Thunderbird due to the hooks still being active.
yuriy.kb
Posts: 3
Joined: January 15th, 2018, 5:17 am

Re: SMTP connect takes minutes with many IMAP accounts

Post by yuriy.kb »

Sorry for the pause. Thank you for trying to help. I did not quite understand your previous post, but I'll attach the complete log file here: https://yadi.sk/i/_nfhKM7E3Rayzn

Procedure:
1. Run thunderbird
2. Create and send a message
3. freeze
4. Inactivity
5. closing the thunderbird.

Removing Kaspersky did not help: '(
Post Reply