From: Valentin M. <fet...@mr...> - 2009-06-24 14:57:23
|
-------- Original Message -------- Subject: Re: [fetchmail-devel] Fetchmail & Yahoo Date: Wed, 24 Jun 2009 15:44:59 +0300 From: Valentin Manea <fet...@mr...> To: Matthias Andree <mat...@gm...> On 06/23/2009 04:38 PM, Matthias Andree wrote: > Valentin Manea schrieb: > > >> 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. >> > > Where would I look for documentation for this Yahoo IMAP server requirement, or > how else have you found out what was needed? Is this "1" really a constant? > Technically, it seems to be RFC-2971 and if the Zimbra server side, or Yahoo's > deployment, actually requires this, it is a RFC-2971 violation, see the "MUST > NOT" clauses in section 3 of said RFC. > > Does it work to send . ID NIL? > I should rather not like to send random data there unless needed, and GUID > raises some suspicions... > > Thank you& best regards > Matthias Andree > Damned Reply, once more with the correct address: There is no documentation, I've just sniffed an older Zimbra Desktop which did not use SSL. You are right, it is not RFC-2971 because I'm unable to login using ID NIL and also it doesn't seem to accept other tags. Also *1* does not seem to be a constant, I've tried some random numbers and I was still able to login. Best Regards, Valentin |
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 |
From: Valentin M. <fet...@mr...> - 2009-06-30 12:43:01
|
On 06/30/2009 11:56 AM, Matthias Andree wrote: > 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 > Hi Matthias, Seems the problem you are referring to is caused by fetchmail not being able to delete the message, in the beginning for me it just downloaded one message and then started complaining about message size. Because of this I've just added the keep directive to fetchmailrc, which looks like this now: poll imap.next.mail.yahoo.com with proto IMAP user '************' with pass "********" is '*********' here options ssl smtphost localhost keep; This configuration has worked fine for me for over a week. As for the server, it seems you can use *imap.mail.yahoo.com* as well. PS: Sorry about the spam, but Thunderbird 3b2 really sucks at replies :-) Best Regards, Valentin |
From: Matthias A. <mat...@gm...> - 2009-07-06 23:25:56
|
Am 30.06.2009, 12:42 Uhr, schrieb Valentin Manea <fet...@mr...>: > Hi Matthias, > > Seems the problem you are referring to is caused by fetchmail not > being able to delete the message, in the beginning for me it just > downloaded one message and then started complaining about message size. > Because of this I've just added the keep directive to fetchmailrc, which > looks like this now: > poll imap.next.mail.yahoo.com with proto IMAP > user '************' with pass "********" is '*********' here > options ssl smtphost localhost keep; > This configuration has worked fine for me for over a week. > > As for the server, it seems you can use *imap.mail.yahoo.com* as well. Well... I think the major issue is that if you aren't using another client, marking a message \Seen also causes failure retrieving subsequent messages. The code above was (accidentally) made part of fetchmail 6.3.10, but I'll not be supporting it. I'm not interested in working around this half-baked Yahoo IMAP stuff. I'm not going to pursue this Yahoo-IMAP any further. If someone's interested, talk to Yahoo first if they plan to fix their server for IMAP compliance... -- Matthias Andree |