Yahoo! Mail IMAP Proxy

UPDATE: It was fun, but this proxy is no longer needed. You can connect directly to Yahoo! via IMAP with the following servers: port 993 (SSL) port 465 (SSL)

There are a few Yahoo! Mail IMAP proxies out there (YPOPS!, FreePOPs), but to be honest, I haven’t had much luck with either of them.  Additionally, switching webmail interfaces to Asia or Classic or whatever can be a bit of a hassle.

Yahoo! supports IMAP on some mobile devices, and now also allows it for anyone using the Zimbra mail client.  Unfortunately, I’m not too fond of that client and much prefer my Thunderbird; too bad it isn’t natively supported.

Luckily, Yahoo’s IMAP implementation isn’t too far off from what other clients recognize; it simply requires a "ID ("GUID" "1")"  to be issued before logging in.  No clients do that (except for these hacked up versions of Thunderbird), so my workaround was to create a simple IMAP proxy.

This proxy simply takes the commands sent to it by your mail client, passes them on to Yahoo, and relays them back to your client.  It all the while looks for your client to issue a "login" command so that it can inject the "id" command to unlock IMAP access.

This program is written in C and has been tested on Linux and Windows (via Cygwin). Read the release notes in the source for more information.  I haven’t written in C for a while, and I know that this program can be improved.  If anyone does so, I’d like to hear from you.

Connection settings:
Username: [email protected]
Hostname: localhost
Port: 3490
SSL: off

Download latest source

Download Windows Cygwin version

View Google Code Homepage

61 comments on “Yahoo! Mail IMAP Proxy
  1. trae_z says:

    hey i’m really sorry to bother you but please can you explain this succinctly step by step by step for the not so computer-wise how exactly this is done (or point me somewhere that it is explained). i’m talking about IMAP and SMTPs access for yahoo. thanks in advance. would appreciate if you email me back your response.

  2. Ameir Abdeldayem says:

    I compiled a version that works in Windows via Cygwin. The download link is in the article. Simply extract all the files into the same location and double-click on yahooproxy.exe. You should see a command prompt window pop up.

    In your mail client, configure it for IMAP on server “localhost” on port 3490. For SMTP, use with SSL enabled.

    When you poll the server you should see all the activity in the command prompt window. If I have time in the future, maybe I’ll make things sexier, but for now, this will do.

    Let me know if you have any questions.

  3. Roger Stern says:

    Thanks so much for doing this. It works like a charm for Thunderbird, but Outlook gets an unreconized imap response error. Any idea why?

  4. Roger Stern says:

    Ameir, I’ve been waiting a long time for something like this. Thanks for doing it.It works like a charm for Thunder bird but fails with Outlook. Outlook says it is getting an unreconized resopnse from the server. And Yproxy is reporting a proxy error. Any idea why?

  5. sam says:

    @Ameir : that’s awesome 🙂 is there any way to use it on a Mac ? I’d love to be able to use from Apple, rather than a modified version of Thunderbird.

    thanks !

  6. Ameir Abdeldayem says:

    Hi Sam,
    You should be able to compile it without issues on a Mac using GCC. I unfortunately don’t have one on-hand to test this out. Here is a gcc install guide; just treat it like Linux:	

    You’ll be using gcc from the Terminal (Applications->Utilities->Terminal). Please let me know how you fare.

  7. sam says:

    Thanks !

    i got it to compile with this error

    $ gcc yahooproxy.c -o yahooproxy
    yahooproxy.c: In function ‘main’:
    yahooproxy.c:238: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’
    yahooproxy.c:285: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’

    then I chmod’ed it, and launched.

    I set up Apple’s Mail with localhost server and 3490 port.

    It logs on apparently but nothing in inbox is showing up/no IMAP folders.

    i got those messages in terminal

    $ yahooproxy ; exit;
    server: waiting for connections…
    server: got connection from ::1
    server: got connection from ::1
    Connected to
    Connected to
    [Chunk 1]: message length = 40 40
    []: * OK IMAP4rev1 server ready (

    out of loop
    [Chunk 1]: message length = 40 40
    []: * OK IMAP4rev1 server ready (

    out of loop

    not sure what to do next.

    i appreciate your help, Ameir 🙂

  8. FireStorm says:

    Using Outlook 2010 and Windows 7 x32 it produces errors.

    Additionally please provide the proper ports/auth settings I should use trying to get into my 2 Yahoo accounts using IMAP and your app.


  9. Ameir Abdeldayem says:

    I will try to get my hands on a Mac so I can debug this further. I’m not sure what differences there are between Linux and Mac’s gcc.

  10. Ameir Abdeldayem says:

    The program supports multiple connections as-is, so you should be able to use both accounts with the same connection settings without any issues.
    Server: localhost
    Port: 3490

  11. trae_z says:

    don’t worry i later found out where you were coming from. anyway details of my struggles and achievements here:

  12. sam says:

    thanks Ameir,
    don’t spend too much time on that, it’s alright

  13. Adam says:

    Now that’s a really neat idea! But it’s probably easier for people to use in Java, see below. Only done basic testing so far.

    [geshi lang=java]
    package yahooProxy;

    import java.util.regex.*;

    public class Main
    private final static int LISTEN_PORT = 3490;
    private final static String TARGET_NAME = “”;
    private final static int TARGET_PORT = 143;
    private final static String ID_COMMAND = “2 id (\”GUID\\” \”1\\”)”;
    private final static Pattern LOGIN_COMMAND = Pattern.compile(“^\\d+\\s+login”, Pattern.CASE_INSENSITIVE);

    public static void main(String[] args) throws IOException
    ServerSocket lServerSocket = null;

    lServerSocket = new ServerSocket(LISTEN_PORT);
    catch (IOException e)
    System.err.println(“Could not listen on port: ” + LISTEN_PORT);

    while (true) new ServerThread(lServerSocket.accept()).start();


    public static class ServerThread extends Thread
    private Socket mClientsocket = null;
    private Socket mServerSocket = null;

    public ServerThread(Socket iSocket)
    mClientsocket = iSocket;

    mServerSocket = new Socket(TARGET_NAME, TARGET_PORT);
    catch (UnknownHostException e)
    System.err.println(“Failed to resolve name ” + TARGET_NAME);
    catch (IOException e)
    System.err.println(“Failed to open socket to ” + TARGET_NAME + “:” + TARGET_PORT);

    System.out.println(“Opened new socket to ” + TARGET_NAME + “:” + TARGET_PORT);

    public void run()
    PrintWriter lServerOut = new PrintWriter(mServerSocket.getOutputStream(), true);
    BufferedReader lServerIn = new BufferedReader(new InputStreamReader(mServerSocket.getInputStream()));
    PrintWriter lClientOut = new PrintWriter(mClientsocket.getOutputStream(), true);
    BufferedReader lClientIn = new BufferedReader(new InputStreamReader(mClientsocket.getInputStream()));

    String lServerLine;

    main_loop: while (true)
    lServerLine = lServerIn.readLine();
    if (lServerLine == null) break main_loop;
    Debug(“Server: ” + lServerLine);
    } while (lServerIn.ready());

    String lClientLine = lClientIn.readLine();
    if (lClientLine == null) break main_loop;
    Debug(“Client: ” + lClientLine);

    if (LOGIN_COMMAND.matcher(lClientLine).find())
    Debug(“INJECTING: ” + ID_COMMAND);
    lServerLine = lServerIn.readLine();
    if (lServerLine == null) break main_loop;
    Debug(“Server: ” + lServerLine);
    } while (lServerIn.ready());


    catch (IOException e)

    private void Debug(String iInput)

  14. First of all thanks for creating this proxy!

    With the help some others I have created a package for the [url=]Freetz[/url] platform (see [url=]here[/url] for details).

    To make things work with Evolution I changed this line:

    [geshi lang=C]if (strstr(buffer, “login”) != NULL || strstr(buffer, “LOGIN”) != NULL) {[/geshi]

    [quote]Sometimes messages don’t load entirely due to the way I check for a complete message from the server (“OK” and “completed”)[/quote]

    What is exactly the problem? How can this be improved?

    Could you make available a download in zip or tar.gz format with a folder containing the source compressed. The Freetz package is now based on a quick and dirty hack, because currently only a plain source is available for download. And to improve things, maybe you can add a version number too.

  15. Bark of Delight says:

    This worked for me on a Mac running Eudora, but not for the regular Apple Mail program. This leads one to suspect that Apple’s program is doing something unexpected.

    In particular, as soon as I set the account email to an [email protected], Apple’s Mail program indicated that the account was now of type “Yahoo IMAP” (as opposed to just “IMAP”). This suggests that Apple Mail has *some* support for Yahoo IMAP, although it doesn’t allow choosing that directly.

    When I get some time I’ll try to debug what is going wrong with this proxy solution w/ Apple Mail. In any case, it’s great to have a method to archive my Yahoo! email as sadly there is no export or archive supplied by Yahoo!

    I don’t want this to turn into a Yahoo! bash, but I myself am leaving Yahoo. They appear to be stuck in the 20th century.


  16. Bark of Delight says:

    Ok, I have found that the problem with Apple Mail and this proxy program is in fact the hello banner. In particular, this line of the code:

    clientmsg(new_fd, “Welcome to Yahoo! IMAP Proxy!\r\n”);

    is tripping up Apple Mail somehow. Commenting out that line (and following the above suggestion of matching “LOGIN” as well as “login”) fixes the problem.

    This is terrific. Thanks again for writing this.


  17. sam says:

    Hi Bark of Delight,
    could you upload this file somewhere and post the link ?
    it really doesn’t work, even after commenting out the Hello line, i still have the same issues as I wrote in the comments a few days ago.
    ie : it doesn’t work at all in Apple Mail :-(
    Thanks :)

  18. Ameir Abdeldayem says:

    I’ve made some changes to the proxy and updated the links in the article. Please try the new version and let me know if it works for you.

  19. Ameir Abdeldayem says:

    Thanks for the “LOGIN” tip; that enabled several other clients to work.

    The problem with checking for a complete message is that sometimes “OK” and “completed” don’t show in the same buffer window, so your email client may lag for a bit before it retries (if it does retry). I’m not sure at this point what other solution there is to this. I’m open to any ideas.

    There is a zip of the source code in the article (bundled with cygwin). What would you like to see in the archive? Are you looking for a Makefile?

    I’ve added version numbers and uploaded the source to Google Code; that should help keep things organized.

  20. sam says:

    cool, it works now !
    thanks !

    i posted the compilation issue on GoogleCode, it’d be easier to find and fix it there i think.

    i don’t know how to run that as a daemon in the background, to ba as transparent as possible.

    Bark of Delight, you seem to know a lot about OSX, do you have any clue ?

    thanks a LOT guys, that’s awesome !

  21. Ameir Abdeldayem says:

    On Linux (and likely OS X), you can run the proxy in the background by using nohup.

    Try this:

    nohup ./yahooproxy &

  22. Adam says:

    The Java version is now on sourceforge at

  23. syrou says:

    Thanks for this fine piece of app. BTW, would it be possible to chain-proxy it’s output? I’m behind an SSH tunnel with a dynamic socks proxy defined.

  24. George says:

    Thanks. It works with KMail!

  25. George says:

    Ameir, thanks again for putting this up. In my first connections to yahoo the connection times out. I have a lot of email data to download and maybe it has to do with the “OK” or “Complete” thing you mentioned. I am using KMail. But I expect after I download everything for it to work fine.

    To Adam if he is listening. The java program fails to download anything, although I can view the folders in the imap account. Maybe fixing the “login” fixes this?


  26. Mike says:

    I’ve got the compiled Windows version working in Windows 7 with Outlook 2007 talking to my two Outlook mailboxes. I can read and delete mail in any folder in either mailbox. I can move mail between folders in the same maibox or out of that IMAP mailbox to Outlook personal folders.

    What I cannot do is move anything into a new folder in different mailbox. Outlook tries then fails with “APPEND ERROR”. In the proxy window, I see:

    [Chunk 4]: message length = 0 0
    Detected 1 blank message(s)
    [Chunk 5]: message length = 0 0
    Detected 2 blank message(s)
    [Chunk 6]: message length = 0 0
    Detected 3 blank message(s)
    [Chunk 7]: message length = 0 0
    Detected 4 blank message(s)
    [Chunk 8]: message length = 0 0
    Detected 5 blank message(s)
    [Chunk 9]: message length = 0 0
    Detected 6 blank message(s)
    server: closing connection with ::1
    [Chunk 2]: message length = 79 79
    []: rs4t NO APPEND error; internal server error. Please try
    again after some time

  27. Dan says:

    OP great job, but guys not every body is computer programmer!
    I mean when you compiled a new version for a different platform wouldn’t be nice to upload it somewhere to help others?
    I would be very thankful if Sam point the Mac version to me, or send it to my email.

  28. Peter says:

    This is a great proxy, I will give it try.

    I have been using a patched of Thunderbird 3.0 and now Thunderbird 3.1 that I got from The is quite outdated.

  29. Dave says:

    I think the idea is pretty nice, but I can not use it because it doesn’t support SSL.

    Are there any plans to support SSL? Or is that too difficult?

  30. Muxx says:

    Hello guys,

    I’ve also tried the proxy, but sometimes login fails and if it works, the folder only shows 1 Mail (each folder the same…) Is this problem known?


  31. Muxx says:

    BIG BIG Thanks, it works like a charm!!! First tried the java-version, but it only shows one mail-header and no content – the .c version works perfektly! Now I finaly have the same mails on my pcs without must use the web-interface. THX!!!

  32. Muxx says:

    Oh, one important question left:

    If I send an email, it couldn’t be saved into the “outbox” also drafts don’t work – what do I wrong? Moving mails work, deleting works, and all the other things seem also to work, but saving new mails don’t work 🙁 The mails are correctly sent, but there is no copy in the folder…

    Would be verry nice, if you could help me with this problem.


  33. Muxx says:

    Also “ALT + F2” do 😀 – just insert “./yahooproxy” and click ok, now the proxy runs in background :D

    Last thing is the “new mail problem” mentioned in an other comment 😉

  34. Ameir Abdeldayem says:

    I’ve never had this problem but if you email me your log (remove your login info) I can try to help you further. It may be related to the OK/completed issue listed in the source.

  35. Ameir Abdeldayem says:

    I’ll run some tests on this; Yahoo’s IMAP implementation isn’t very friendly and might limit write access.

  36. Muxx says:

    I’m sry, it wasn’t your great proxy, but the java one – after switching to yours, nearly everything was fine 😀

  37. Amir Emon says:

    Hi Ameir,

    This is really cool thanks for your help.. I am able to use the program but I am experiencing some problems with my Thunderbird 3.1.. I’m using Windows 7 32bit..
    everytime I moved from one folder to another it ask for my password or to try a new password.. I have checked the box to remember my password but It seems like it’s coming on and on if I’ll check my email or if I have to switch folders.. And also odes the command prompt window needs to be open always?

    Thanks! You’re really great..

  38. Dave says:


    Yahooproxy0.3 worked for me on the first try for reading e-mail and moving e-mails among folders in my yahoo account (to which I am migrating from wretched hotmail). I am using outlook 2003 client.

    Only known problem for me – I am not yet successful to send e-mail using the yahoo account and outlook 2003 client.

    My settings right now are:

    outgoing mail server:
    my outgoing server requires authentication: (checked)
    use same settings as my incoming mail server: (checked)
    outgoing server (SMTP) port: 25
    this server requires an encrypted connection (SSL): (checked)

    Is this correct from your experience?

    Thank you very much!

  39. Ameir Abdeldayem says:

    If you’re using SSL, you should be on port 465. Try that, and if it doesn’t work, undo SSL and use port 25. Do one or the other, although the former is more secure. Let me know how it goes.

  40. Ameir Abdeldayem says:

    Hi Amir, nice name :)
    The Yahoo IMAP server doesn’t like switching between folders fast, nor having webmail and IMAP open at the same time. Give it a second to switch between folders and make sure webmail is closed. Other than that, I’m not too sure what the issue could be; I’m able to navigate things fine on my end. Let me know what happens.
    As far as hiding the command prompt, that can easily be done with something like AutoIT. If interest is strong enough, I’ll make it happen. Keep your eyes peeled 🙂

  41. Linton says:

    Hi guys,

    Can someone post clear instructions on how to enable this for use will MAC mail?

    how do i ‘point’ mail to look for the proxy?



  42. Joe says:

    Hey! I came across your GREAT Yahoo IMAP proxy, and it works like a charm. Only bugs I can see [and it may be because of Yahoo itself and not your proxy]:

    1. My client times out often with error “idle too long” if I leave my client open with Yahoo account active.

    2. While I can move files OUT of my yahoo account to local folders, and move items between folders on the Yahoo account, I cannot take an item from my local folders and drag it IN to the Yahoo account. I am most concerned with moving items SENT from my mail client to my SENT folder on Yahoo.

    Any suggestions would be appreciated!

  43. guy says:

    it doesn’t work with windows live mail

  44. guy says:

    I keep getting tis error on windows live mail:

    The connection to the server failed:
    Your IMAP command could not be sent to the server, due to non-network errors. This could, for example, indicate a lack of memory on your system.

    Server: localhost
    User name: lachelmelon
    Protocol: IMAP
    Port: 993
    Secure(SSL): 1
    Code: 800ccc0e

  45. Joe says:

    Hi -

    As Windows Live is attempting to access the account, what do you see in the command window for the proxy?

    Try setting the server name to [should work with localhost too, but you never know].

    I have it working fine with Windows Live Mail, aside from the bugs I listed above (it won’t handle moves between local and IMAP folders and has a short idle limit). If you e-mail me at [b]JOE AT RUGGIEROAV DOT NET[/b], I can let you test it with an instance I have running on a remote server.

  46. Ameir Abdeldayem says:

    Your username should be your full Yahoo email address, and you should disable SSL. Also, your port should be 3490. The IMAP proxy will connect to the proper port (143) for you.

  47. Angel Blue01 says:

    Hello and thanks for this program. I’ve gotten Thunderbird 3.0 to work with it in Windows without any trouble.

    However, I mostly use Linux that has been having problems. I use openSUSE 11.2 and KDE SC 4.5. I compiled the program without any trouble but the mail checker plasmoid doesn’t seem to work with it. In the Konsole window running yahooproxy I get the following output:

    server: waiting for connections…
    server: got connection from
    Connected to
    [Chunk 1]: message length = 201 201

    out of loop
    []: 001 LOGIN [email protected] mypassword

    [Chunk 1]: message length = 71 71
    []: 001 NO [AUTHORIZATIONFAILED] Access to this service is not permitted.



  48. Anas says:

    Does this work with outlook 2010 x64 in Windows 7 x64.

  49. Picses says:


    I had been literally wasting my time in order to get yahoo mail free in Opera Mail Client.
    I could not even guess that it would be this simple!!!

    Thanx a bunch.

  50. Vlad S says:

    can you please offer us an in depth tutorial on how to set up this proxy under ubuntu and how to configure thunderbird 3 for the unexperienced in the land of computing.
    thank you

Leave a Reply

Your email address will not be published. Required fields are marked *