From: Peter P. <ro...@ri...> - 2020-10-10 07:56:19
|
On Sat, Oct 10, 2020 at 01:04:24AM -0500, Ranjan Maitra wrote: > On Sat, 10 Oct 2020 01:28:02 +0200 Matthias Andree <mat...@gm...> wrote: > > > Am 09.10.20 um 23:16 schrieb Ranjan Maitra: > > > On Wed, 7 Oct 2020 20:33:13 +0200 Matthias Andree <mat...@gm...> wrote: > > > > > >> Am 07.10.20 um 19:00 schrieb Ranjan Maitra: > > >>> On Wed, 7 Oct 2020 18:39:41 +0200 Matthias Andree <mat...@gm...> wrote: > > >>> > > >>>> Am 07.10.20 um 06:51 schrieb Ranjan Maitra: > > >>>>> According to the site, that may be dated, but fetchmail has oauth2 support from fetchmail7. Will it be available soon? > > >>>> Ranjan, > > >>>> > > >>>> that depends on how leniency of your definition of "soon". > > >>>> > > >>>> First we will have a 6.5 release branch, and that has not yet happened, > > >>>> so I expect that 7.x will be a matter of 2021, but if you are running it > > >>>> from the up-to-date "next" branch in Git (available on Gitlab and > > >>>> Sourceforge), feel free to file bug reports. > > >>>> > > >>>> Regards, > > >>>> Matthias > > >>> Thanks, > > >>> > > >>> I have used fetchmail 7 without much of a problem (or something that I have noticed, anyway). Is it possible to backport the patch for oauth2 in the 6.x.x releases? I prefer using the rpms released by the distributions. > > >> I am not doing that, and the purpose of the existing 6.x.y branches is > > >> compatiblity as we update y and if possibly also when updating x. There > > >> may be minor features in 6.5.y. > > >> > > >> 7.x.y is for major changes. > > >> > > > So, I was looking at https://sourceforge.net/projects/fetchmail/files/branch_7-alpha/ and here, there has not been an update here since about 2 years ago. Is the git version more up-to-date? > > > > > Yes it is, and I don't think I will be doing many releases from > > development branches before it's release candidate time. > > We have Git and we have autoreconf. > > > > Thanks! I was looking around git and I guess the python code to get the token file is perhaps here: https://sourceforge.net/p/fetchmail/git/ci/next/tree/contrib/fetchmail-oauth2.py#l140 > But then, I was wondering where is the code in fetchmail that makes it work (i.e. makes use of the oauth2 written in the rc file): > > poll imap.gmail.com protocol imap > auth oauthbearer username "US...@gm..." > passwordfile "/home/path/to/access_token_file" > is LOCALUSER here sslmode wrapped sslcertck > > This is for gmail, mine is for office 365 so I am wondering if there are areas in the main source code that I have to modify. (I have the python code needed to get the token.) It seems to me that fetchmail has to recognize and make use of the oauthbearer hence my question. To answer your direct question, the code is in parts of imap.c and pop3.c, as well as the aptly named oauth2.c and oauth2.h files, also with configuration-related pieces sprinkled across several other files. However, if you are thinking of backporting fetchmail OAUTH supprt to a 6.x branch... please bear in mind that I would be very, very wary of (in fact, I would not do it at all) trying to copy five, ten, or even two hundred lines from a heavily-reworked codebase. There may be several types of issues: - the new code uses helper functions that are not present in the old code: you have to either backport them, too, or rewrite the code to not use them. This is a rabbit hole that once you start falling in, it takes you days and weeks to reach any kind of bottom... and then you find out that you have practically "backported" two-thirds of the rest of the new code - the new code uses functions with new or changed arguments: you have to either backport them (and adapt all the other pieces in the old code that call them), or rewrite the code to not use them; see above about the rabbit hole - the new code uses data structures that exist in the old code, *but* have some of the fields removed or the meaning of some of the fields changed: this is the most "evil" one, since the code will compile, but then, when you try to run it, some other function will expect this field to have this value or that field to have a value consistent with the other one, and things will break, either badly, or in subtle ways that will be very, very hard to detect So... yeah. I would either try to use the 7.x version directly, or wait. G'luck, Peter -- Peter Pentchev ro...@ri... ro...@de... pp...@st... PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13 |