Thunderbird IMAP hangs on IP address changes



14 years ago
8 years ago


(Reporter: jhaar, Unassigned)



Firefox Tracking Flags

(Not tracked)



(1 attachment)



14 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050224 Firefox/1.0.1 Fedora/1.0.1-1.3.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050224 Firefox/1.0.1 Fedora/1.0.1-1.3.1

I am using Thunderbird 1.0 over IMAP-SSL on a Fedora Core 3 laptop. Whenever my
IP address changes whilst Thunderbird is already running (e.g. I change from
Ethernet to Wireless, or I suspend, take the laptop to another network segment
and restore), Thunderbird HANGS. It doesn't figure out that the old existing
established IMAP connections are now dead and just hangs. Only restarting
Thunderbird consistantly fixes it. I can try going offline (no download) and
online again - and that can rarely work - but mostly doesn't.

We are a big Outlook site, and I must say that Outlook 2003 (over MAPI I admit)
really handles this well. It looks like if it notices existing connections
aren't responding, it tears them down and starts new ones - really agressively.
And the really great thing is - it doesn't annoy the user while it's doing it -
no popups about the network being down/etc - it just fixes it.

Can things like the IMAP IDLE option be used to detect if an existing IMAP
connection has died? Maybe Thunderbird could do IDLEs every 10-20 secs when it's
not doing anything else, and if no response arrives in (say) 10 sec, drop that
IMAP connection and start a new one. If the new one fails - then the user can be
informed. I know the IMAP server authors aren't impressed with such actions -
but frankly they've got to appreciate it's end users who matter - not their
beautiful code ;-)

Just an idea :-)

Reproducible: Always

Steps to Reproduce:
1. run Thunderbird over IMAP-SSL
2. change IP address
3. See Thunderbird hang

Actual Results:  
Thunderbird hangs and nothing but restart fixes it

Expected Results:  
Should figure out a network change has occured and reinitialize itself

Comment 1

14 years ago
I have the same problem over an ADSL-line. When my NAT-Router has to change its
IP (disconnection every 24 hours), Thunderbird freeze.
The IP (Private network) of my Computer does not change, but the IMAP-SSL link
is broken because of the new public IP.

I use Debian Thunderbird 1.0.2.

Comment 2

14 years ago
Another addition to this.

Thunderbird can also hang for unknown reasons (i.e. not due to network changes).
When it hangs - it hangs on one IMAP folder - over even just one message. If you
move to another IMAP folder, that can respond fine - but going back to the first
"hung" folder tends to be still hung. I can then even go offline in
Thunderbird-1.0.2, and entering other folders just responds immediately as
expected (as I'm offline TB doesn't have to do anything other than show me
what's in cache), but going back to the hung folder.... ends up with an
hourglass and a hung folder. At that stage, nothing short of exiting TB can help.

Sounds like a thread or TCP session hanging - leading to one folder being
affected while others work?

Comment 3

13 years ago
I am running Thunderbird 1.0.6 and connecting to an imap server with SSL.  I am
seeing something very similar.  Thunderbird frequently hangs up for no apparent
reason on a particular folder (often "Inbox"). This seems to happen frequently
when I wake my laptop up from sleep or change networks. Most of the time, I can
"fix" the problem by killing Thunderbird and restarting.  Note that this problem
seems more frequent with unpredictable/slow networks (I have a Sprint card).

Further, there are some times when this problem doesn't go away unless I remove
the imap directory from my profile and then restart.  Worse, this effect seems
magnified if I try to download the inbox for offline use.  Then, Thunderbird
seems to be able to get stuck in such a way that I need to delete the Inbox and
Inbox.msf files and restart. 

Comment 4

13 years ago
+1 here too.  I'm on WinXP, using trunk builds of Thunderbird.

Most frustrating when I disconnect and move my laptop around the building at work and have to keep restarting Thunderbird because it keeps hanging.

What would be smart would be detection of the loss of link, or the route to the remote server timing out, and Thunderbird _automatically_ going offline.

Ditto re: Outlook, it handles this properly.  Much as I hate admitting Outlook does something better......

Comment 5

13 years ago
*** This bug has been confirmed by popular vote. ***
Ever confirmed: true

Comment 6

13 years ago
Has anyone tried Thunderbird 1.5beta2 to see if the problem still exists?

Comment 7

13 years ago
Yup. Seems to be same problem with 1.5Beta 2.  Pretty annoying bug.  Also, not consistent -- sometimes it happens, sometimes it doesn't.

Comment 8

12 years ago
I can confirm this bug exists on Mac OS X as well, and I'm attaching a stack trace sampled while it was happening. From what little I can discern, it looks like all the IMAP threads are waiting on a lock (I'm guessing the same one).

This is from version (20060909)

Hope this helps someone who understands the code base better than I.

Comment 9

12 years ago
Created attachment 242595 [details]
Stack trace of sampled thread activity

Comment 10

12 years ago
does this happen with a 2.0 alpha build? I fixed some race conditions like this...

Comment 11

12 years ago
I'm about to install 2.0b1pre and see if the problem still occurs. Will advise.
QA Contact: general

Comment 12

11 years ago
I am also seeing this on OSX v1.5.0.12 (20070509). I notice it when switching from wired to wireless at work. If the IP changes out from under TB then it will hang and I have to force quit. I am reading mail on two IMAP/SSL accounts.

Comment 13

11 years ago
I upgraded to and now there is just a long delay when the IP changes, but it does recover and I do not have to force quit.

Comment 14

11 years ago
I don't get a hang, but the connection times out and I have to restart TB before I can connect again.  I see this primarily when switching between VPN and non-VPN (intentionally or because wifi drops temporarily), but I also see it on switching hard wired to wifi.  

Comment 15

11 years ago
I experience the same problem as Adam describes in Comment #14, using Thunderbird (20070824) on Ubuntu Linux 6.06 (x86) with the Cisco VPN client.

It takes about a minute or two for Thunderbird to notice that a change has occured. Firefox seems to catch up faster.

Quitting and restarting Thunderbird always helps, which makes this observation a possible dupe of bug #344977.


10 years ago
Assignee: mscott → nobody

Comment 16

10 years ago
Still true for Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b4pre) Gecko/20090306 Shredder/3.0b3pre.

takes a long time to recognize that the IP address has changed.  Restart is faster.  

If I could code worth a damn, I'd fix it.  :-(  This is 4+ years old now...
IMAP usually uses IDLE, and AFAIK Thunderbird terminates IDLE and reissue IDLE each 29 seconds to keep cached connection.
>  and clients using IDLE are advised to terminate the IDLE and
>  re-issue it at least every 29 minutes to avoid being logged off.
I think this is one of the reasons why Tb's problem relates to PC's IP address change occurs on IMAP but doesn't occur on POP3 or SMTP, as bug opener says.

To all problem reporters:
Please try following when you experienced problem due to PC's IP address change again.
(1) Disable IDLE and re-enable IDLE of an IMAP account only.
    => Will the IMAP account work as expected?
(2) Go "Work Offline" and back to "Work Online".
    => Many comment posters to bugs for similar issue say "this was effecive".
       Can this be a recovery procedure of your problem?
(3) If (2) is not effective,
    Restart of Thunderbird (I think simplest & quickest way, as richard says)

Note: And Tb still has problem around connection failure in IDLE processing. And Tb trunk nightly had problem around "Go to offline mode" after landing of "Auto Sync" feature(this issue is possibly not resolved yet).
So "restart of Tb" is simplest recovery procedure which is currently available.
Component: General → Networking: IMAP
Product: Thunderbird → MailNews Core
QA Contact: general → networking.imap

Comment 18

8 years ago
there should be some dupes of this, but what to query?
Severity: normal → critical
Keywords: hang

Comment 20

8 years ago
I'm not experimenting any Problems anymore with Thunderbird (Icedove in fact) 3.0.11 on Debian. I have not been experimenting the problem for months (years ?).

Comment 21

8 years ago
I have not seen this problem for a long time (many versions of Thunderbird).

Comment 22

8 years ago
great to hear it's gone. thanks for the feedback.
Last Resolved: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.