From: Matthias A. <mat...@gm...> - 2009-06-30 10:56:05
|
Am 23.06.2009, 10:56 Uhr, schrieb Valentin Manea <fet...@mr...>: > This has been hunting me for a while now but it seems after Yahoo > released Zimbra it is possible to get your email from Yahoo without > those ugly solutions. The catch is that before authentication you have > to send a custom command to the server. I've made a small change in > imap.c and now finally I can use fetchmail with my free yahoo account. > As I'm not that familiar with the developing for fetchmail I would > really not send a patch but only describe what I did. > > So I've just added this line: > gen_transact(sock, "ID (\"guid\" \"1\")"); > in *imap_getauth* after the SSL stuf. This doesn't seem to affect normal > IMAP servers in any way. Hi Valentin, I've tried this, and it works to some extent. On the first attempt, I could only download one message (which fetchmail marked \Seen). After that, the server would complain "NO mailbox was modified" on all subsequent messages I tried to download... have you observed such behaviour? Beyond that, fetchmail in verbose mode complains about size mismatches, namely that messages didn't have the expected size. I haven't yet investigated what causes this. Finally, I don't know the proper IMAP-SSL server name. imap-ssl.mail.yahoo.com gives me the connection, but the certificate is issued for *.imap.mail.yahoo.com, so I get complaints about invalid certificates. I'm currently testing this patch (also attached) which only tries this nnn ID ("guid" "1") on yahoo.com servers, but it's not ready for inclusion for the reasons above: diff --git a/imap.c b/imap.c index 5347492..54309f7 100644 --- a/imap.c +++ b/imap.c @@ -478,6 +478,15 @@ static int imap_getauth(int sock, struct query *ctl, char *greeting) */ ok = PS_AUTHFAIL; + /* Yahoo hack - we'll just try ID if it was offered by the server, + * and IGNORE errors. */ + { + char *tmp = strstr(capabilities, " ID"); + if (tmp && !isalnum(tmp[3]) && strstr(ctl->server.via ? ctl->server.via : ctl->server.pollname, "yahoo.com")) { + (void)gen_transact(sock, "ID (\"guid\" \"1\")"); + } + } + if ((ctl->server.authenticate == A_ANY || ctl->server.authenticate == A_EXTERNAL) && strstr(capabilities, "AUTH=EXTERNAL")) Best regards Matthias -- Matthias Andree |