Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.

IMAP support for yahoo mail

Skip to first unread message


Sep 7, 2009, 3:08:37 AM9/7/09

It is possible to access yahoo mail accounts through The problem is that it is necessary to send the
ID ("GUID" "1")

before the LOGIN command. So to get it to work in thunderbird it would
be necessary to have thunderbird send this command.

I downloaded the source for thunderbird- and successfully
compiled it. Then I tried to add some code to get it to send that
command. I thought it would make sense to add it to the file mailnews/
imap/src/nsImapProtocol.cpp and specifically the function
nsImapProtocol::InsecureLogin(), which is where it seems the LOGIN
command is being sent.

I tried adding the following code:
nsCString command_guid (GetServerCommandTag());
command_guid.Append(" id (\"GUID\" \"1\")"CRLF);

nsresult rv_guid = SendData(command_guid.get(), PR_TRUE /* suppress
logging */);
if (NS_SUCCEEDED(rv_guid)){
printf("Success in sending id!\n");

but it doesn't seem to work. Thunderbird says something like can't
connect to server and asks for the password again. Looking at the
packets that are sent I can see that the ID command is sent. But it
seems the LOGIN command is not. Although the response to the LOGIN
command says LOGIN OK (indicating a successful login).

Anyways I tested downloading a message manually using the following
sequence of commands through "telnet 143":
1 capability
2 id ("GUID" "1")
3 login "" "password"
4 list *
5 examine Inbox
6 fetch 1 all
7 fetch 1 body[text]
8 logout

and I was also able to get it working in mutt. I explain how to do it
on my website at:

Anyways any help would be appreciated.

Best regards,

David Bienvenu

Sep 7, 2009, 10:34:57 AM9/7/09
Hi Bijan,
First of all, I would not suppress logging, so then you can generate
an imap protocol log and see what the server is responding.

My guess is that you're not parsing the response of the command, and
confusing our parser in general, because it probably sees the response
from the ID command after sending the LOGIN command and tries to parse
it. So you need to somehow consume the response of your ID command
first, before sending the login command. Usually we use
ParseIMAPandCheckForNewMail() to parse the server response. I don't know
what the server is returning in this case, so I have no idea if our
parser as it is now will be happy with the response.

- David

Bijan Soleymani

Sep 7, 2009, 4:05:14 PM9/7/09
Thanks David,

I enabled imap logging and removed the code to suppress logging when
sending the id command and I also made a call to
Here is what the log says:
-1299633264[89925a8]: 2 id
("GUID" "1")^M
-1299633264[89925a8]: ReadNextLine [stream=8992e54 nb=84 needmore=0]
-1299633264[89925a8]: * ID ("name"
"imapgate" "support-url" "" "version" "3.5.55")^M
-1299633264[89925a8]: ###!!! ASSERTION: syntax error in generic parser:
'!error', file nsIMAPGenericParser.cpp, line 92
-1299633264[89925a8]: ###!!! Break: at file nsIMAPGenericParser.cpp, line 92
Syntax Error on line: %s: * ID ("name" "imapgate" "support-url"
"" "version" "3.5.55")^M

So it seems thunderbird is having trouble parsing the response to the id
command which is:
* ID ("name" "imapgate" "support-url" "" "version"

On the positive side this is the log of the imap packets sent and
received (according to tshark):
5.111712 -> IMAP Response: * OK IMAP4rev1
server ready (3.5.55)
5.112920 -> IMAP Request: 1 capability
5.200712 -> IMAP Response: * CAPABILITY
8.807688 -> IMAP Request: 2 id ("GUID" "1")
8.896215 -> IMAP Response: * ID ("name"
"imapgate" "support-url" "" "version" "3.5.55")
8.897354 -> IMAP Request: 3 login
"" "rosa123"
9.291807 -> IMAP Response: 3 OK LOGIN

which indicates that thunderbird is now sending the LOGIN command at least.

I will try looking into the parser and see what is wrong.

Thanks again,

Bijan Soleymani

Sep 7, 2009, 4:33:57 PM9/7/09
I managed to get it to work. The problem was in:

Specifically the function:

This is the function that figures out what the response is. It has a
switch that deals with each possible command. It didn't know about the
id command so flagged it as an error.
All I had to do was add:
case 'I':
if (toupper(fNextToken[1]) == 'D')
else SetSyntaxError(PR_TRUE);

where id_data() is a function to process the rest of the data relating
to the id command. Here is the code for that (I copied it from the one
for the language command, language_data()):
void nsImapServerResponseParser::id_data()
// for now, just eat the id data....
// eat each language returned to us
} while (fNextToken && !fAtEndOfLine && ContinueParse());

I think this would be really useful to a lot of people using yahoo mail,
because the imap access works really well. The only problem I can see is
if a lot of people start using this yahoo might block it. But I don't
think that is that likely as both freepops and YPOPs use this method to
download mail form yahoo. So yeah maybe incorporate this into
thunderbird, or make it an extension.

Thanks again,

Bijan Soleymani

Oct 7, 2009, 12:52:34 AM10/7/09
I have uploaded binaries for Thunderbird 2 with yahoo IMAP support
compiled for Ubuntu (which might work on other Linux distributions) to
my site:

I am now trying to compile a windows version. It should be up eventually.

There is also a binary for mutt with similar support for yahoo IMAP.


Bijan Soleymani

Oct 7, 2009, 5:14:36 AM10/7/09
The windows version is now available:

Also not only is it possible to receive mail through IMAP from but it is also possible to send mail through SMTPs
through All that is necessary is to choose SSL and
port 465. You can then use your yahoo email address as username along
with your normal webmail password. This also applies to the IMAP, except
that the IMAP does not run over SSL.

Again you can read about it on my site:

and it's also on wikipedia (though who knows for how long):!_Mail#Free_IMAP_and_SMTPs_access

I hope yahoo doesn't disable this. I mean if Gmail can offer IMAP why
not Yahoo?



Oct 11, 2009, 7:08:07 AM10/11/09
Does TB work better with Yahoo IMAP vs Google IMAP???

on 10/6/09 11:52 PM Bijan Soleymani said the following:

Bijan Soleymani

Oct 12, 2009, 1:23:52 AM10/12/09
Hey Dan,

Dan wrote:
> Does TB work better with Yahoo IMAP vs Google IMAP???

No, I would say not. It probably works better with Google. Mainly
because of the following two issues with Yahoo IMAP:
1. Folders can't have subfolders on Yahoo. Although you can create
folders with a . in them, when Thunderbird requests the list of folders
the Yahoo IMAP server returns the (\HasNoChildren) flag for every
folder. I think this makes Thunderbird display them as separate folders.
I could probably check if the user is accessing Yahoo IMAP and alter
this behaviour in that case, but I don't know if that's the right thing
to do...

2. If you have lots of messages in a folder downloading headers is slow
on Yahoo. Of course this is only a problem the first time you open that
folder, because Thunderbird caches the headers, so the next time it will
only have to download the new headers. I'm assuming GMail is faster at
this, however I don't have many messages in my GMail account so I don't
know how fast it is for sure.



Nov 26, 2009, 7:40:45 AM11/26/09
On Oct 7, 11:14 am, Bijan Soleymani <> wrote:
> The windows version is now available:
> >>> "" "rosa123"

can you modify and compile thunderbird pls?

May 25, 2014, 11:50:57 PM5/25/14
Hi my name is criselda Greig Ihave problem log in to my account of or my old phone number is 808-469-6315 and my new number-808-397-7728 pls can you send my password so I can look up my email
0 new messages