Closed Bug 716791 Opened 13 years ago Closed 13 years ago

Thunderbird (v3.1.7) fails to connect to SMTP server on mail send

Categories

(Thunderbird :: General, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: RamseasTechDev, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Build ID: 20111220165912 Steps to reproduce: [.. Hijacking text area fields to provide as much context as I can] Issue ... Composed mail message - Subject: Test Message: Test Clicked Send Workaround solution: - Abort the send - Copy message content to clipboard (and or a text file) - Close and restart Thunderbird (including closing any open compose messages) - Compose new message - Copy from clipboard - Click send Thunderbird dialog appears of "Looking up <SMTP server> ..." where <SMTP> server in this case was smtp.gmail.com ... Obviously, connecting and sending the mail message is desired. Actual results: Environment: - Windows 7 - Thunderbird release v3.1.7 (happens very very very frequently) (also happened regularly in TB v3.1.6 .... but I don't recall it occurring in my previous TB install ... which probably was 3.1.5 or whatever was previous since I usually do the upgrades) - Avast AntiVirus (free) v6.0.1367 (up-to-date) Thunderbird manages over 20 email accounts - a couple are Yahoo ... haven't encountered problem with Yahoo but I don't use those accounts as frequently .. and they are Pop3 accounts anyway - rest are Google GMail accounts ... however some are normal gmail accounts (eg, MyName@gmail.com) ... Majority of others are Google Apps domain mail server accounts (eg, WebAdmin@MyDomain.com) ... send SMTP lookup failure occurs with any of the gmail-based accounts - ie, does not appear to be specific to a Google Apps account or a normal gmail account Expected results: In Thunderbird ... ... the gmail accounts are set up with: Server Settings -> Connection Security -> "none" ... reason is Avast AntiVirus acts as a relay which 1) scans the plain text message for viruses 2) establishes the secure connection with google's SMTP servers (usually SSL but might use TTL too) ---- When first open Thunderbird application - can send mail successfully (even while it has background processing of checking and downloading messages) However, the mail send failure eventually begins after letting Thunderbird sit for a few minutes ... ... note ... I usually Alt-Tab to some other application and return to Thunderbird ... However, it happens even if Thunderbird is the only application running after a fresh reboot of the computer. If I had to venture a guess at the problem ... Thunderbird and/or Avast is not releasing (or not properly reusing) SMTP connections. It is possible this is a problem with Avast. However, this problem appeared with upgrading to Thunderbird 3.1.6 ... happens every time for me. Feel free to contact me if need additional information or to help isolate the problem.
Side note: Planning to update to the new TB 9.x but wanted to let it age a bit beyond v9.0.1
Follow up: - Let TB sit and spin on sending a message - Eventually (after about an hour) the following message appeared "An error occurred sending mail: The mail server sent an incorrect greeting: concurrent connection limit in avast! exceeded(pass:0, processes:thunderbird.exe[50])."
(In reply to DevByStarlight from comment #0) > It is possible this is a problem with Avast. Based on your assumption; can you disable it and check?
Yes, try to disable Avast temporarily (or setup TB to connect directly to the server). You could also try to upgrade to the current TB version in the 3.1. branch. Also, the workaround coult probably be refined: After aborting the Send, just press "Send later", it should go into Unsent Messages (or Outbox). Then restart TB and rightclick on that folder and choose Send unsent messages.
Hi Thanks for feedback. @aceman ... yesss ... good idea ... however ... I have Thunderbird configured to save drafts on the server (so I can access them from wherever, etc). I could change it to save locally, in which case that would allow for the workaround you mentioned. @Hashem (and general update/reply) I fiddled with some of Avast's email scanning options. * Scenario #1 - Avast mail "shield" enabled but disabled the "scanning inbound/outbound" mail messages * Scenario @#2 - disabled Avast's mail shield entirely and configured Thunderbird to connect with Google directly. The difference between #1 and #2 is ... * In Scenario #1, Avast still acts as a relay but does not actually scan inbound/outbound messages for viruses. The idea was to take out the virus scan itself as a variable in the equation ... in case that was causing the hang (doubtful) * In scenario #2, Thunderbird bypasses Avast entirely - effectively removing Avast as a variable in the equation. Results: * In Scenario #1 - avast as relay only - Thunderbird still eventually gets stuck on the "looking up smtp" step. (This occurs after only a few minutes ... probably after TB checks the server for new mail a few times given the twenty or so accounts I have it checking) - So it's not the virus *scan* itself (no surprise) * Scenario #2 - bypass Avast altogether - Seems to work fine / normal / as expected - I've basically had the same instance of the Thunderbird application running most of the day without running into the SMTP lookup problem. NOTE: I have not had any problems downloading new mail at all - before or after this bug report. I've only encountered it on the compose and send. Conclusion: Well ... a bit of hand-waving guesswork ... :) When Avast is enabled as a relay, there are essentially two links in the chain: Link 1) Thunderbird to Avast (which is plain text, no SSL or encryption) Link 2) Avast to Google gmail smtp server (which would be SSL/authenticated) Presumably, each link would have an Open/Close on the socket connection. Downloading seems to work fine. And downloading happens far more often than sending. That would involve opening and closing(?), say, 20 connections (one per account, yes?). Could there be a leak in there where a resource isn't being closed / released? Are those "check mail" connections released each time a check mail concludes? Or, once established, are they held for future check mail queries until the Thunderbird application shuts down? Perhaps, I simply have more email accounts .. with each account wanting to establish it's own network connection simultaneously ... than Avast expected.
I'm going to try the following and see what happens. Technically, I don't need to check *all* of my mail accounts *all* of the time. So I'm going to disable the "check automatically" for some of my lesser used / less busy accounts (eg, webadmin account, etc) ... I can check them manually for a little while. My thought is to reduce the number of mail accounts simultaneously creating connections. Perhaps avoid running into the concurrent connection limit. The limit appears to be an Avast limit and not Thunderbird ... unless Thunderbird is leaking somewhere - not sure if I want to dive into debugging that just yet. I'll let you know. Probably can background this bug unless others are running into the issue as well. I'm also going to contact the Avast folks and see if they're aware of concurrent connection limits and, if so, if they would be so kind as to increase it. :) BTW: Thanks!!
Ha ha ha ha. Okay. The answer's been slamming me in the face. It's not Thunderbird. It *is* avast. Avast intentionally limits the number of simultaneous connections to 50 - as a partial defense against, and detection of, mail spam viruses. The fix: Change Avast INI settings to allow for more connections. It was basically a coincidence that I added another email account and ran into the Avast limit about the same time I updated to 3.1.6 (and now TB3.1.7).
Marking bug as "Resolved" (unless anybody has objections)
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You have 50 accounts in TB? :) You could also leave automatic checking of each account on, but change the checking interval in each account so that they do not overlap. Give like 19 minutes on less needed accounts and 8 on more important ones (even give each one a different number from 1 to 20 or more). Do not give 20 and 10 which would overlap soon (each second check of the 10-minute account). So try to find numbers that only meet very rarely.
@aceman ... Ooooo! - excellent idea. I have the check email interval at the defaults. But varying them is good in general. * I'm not sure if helps on the "open connections" since it would seem TB keeps the open connection around once created (until application shuts down) ... [unverified] [I've built some websites - mostly initial "starter kit" sites and some intranet sites for some local businesses. Example, browser front-end interfaces to view/update company database data and that sort of thing. So I have a number of "web admin" type email accounts. Also why Thunderbird is so nice - all accounts in one place.]
Whoops ... totally forgot the reason I initially came back ... After changing the Avast INI setting to allow more connections I have not encountered the SMTP lookup problem. I only increased the # by a few - to see if maybe it was a leak on open connections. Does not appear to be any leaks. Done. Done. And, Done.
It would be good to find out if TB really does not close the connections. I would hope it does. POP3 servers (with thousands of users) would not like to keep permanent connections open. Maybe Avast is keeping them open. You can monitor it via netstat (even on Windows). Tell us what you see.
You need to log in before you can comment on or make changes to this bug.