Thunderbird search on server seems broken: How to debug IMAP conversation?

2

I search in my IMAP folder Archive/2016 for the term "foo". There are several messages containing this word, but the search (ctrl-shift-f) tells me that there are not messages with this word in the body.

I use "search on server".

This looks like the IMAP server does return the wrong results.

How can I debug this?

Is there a way in thunderbird that I can see the IMAP commands that get send to the server and the responses which I get?

Since the communication is encrypted wireshark does not help :-(

guettli

Posted 2016-08-16T05:50:33.127

Reputation: 347

Answers

1

If you suspect the IMAP server is giving you the erroneous output, why don't you test it from command line and see for yourself?

Establisth a TLS connection with the IMAP server:

$ openssl s_client -connect imap.server.com:993

Log in and go to your inbox:

>>a1 LOGIN username password
<<a1 OK Logged in.
>>a2 SELECT INBOX
<<a2 OK [READ-ONLY] Select completed.

Search the body of your inbox messages for "foo"

>>a3 SEARCH BODY foo
<< [search results]
<<a3 OK Search completed.

Refer to IMAP RFC for additional commands. You didn't specify your OS, but openssl builds exist for most of them.

Dmitry Grigoryev

Posted 2016-08-16T05:50:33.127

Reputation: 7 505

1Nice, I can speak German, English and a bit French. Now I can talk IMAP. Thank you. Works good for debugging. – guettli – 2016-08-25T11:43:16.760

1

You can setup https://www.stunnel.org on your host so it connects to real IMAPS (TLS) server, and then configure thunderbird to make unencrypted IMAP connection to localhost port on which stunnel listens. After that you can use wireshark to sniff localhost traffic, and see it unencrypted.

Matija Nalis

Posted 2016-08-16T05:50:33.127

Reputation: 2 107