Hello community,

here is the log from the commit of package getmail for openSUSE:Factory checked 
in at 2018-05-11 14:27:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/getmail (Old)
 and      /work/SRC/openSUSE:Factory/.getmail.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "getmail"

Fri May 11 14:27:56 2018 rev:25 rq:605147 version:5.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/getmail/getmail.changes  2018-01-05 
01:00:08.129640843 +0100
+++ /work/SRC/openSUSE:Factory/.getmail.new/getmail.changes     2018-05-11 
14:28:00.124687146 +0200
@@ -1,0 +2,7 @@
+Wed Apr 04 17:00:00 UTC 2018 - [email protected]
+
+- Update to 5.6
+  * add Gmail-specific XOAUTH2 login support for IMAP.
+  * fix references to version 4 in README.
+
+-------------------------------------------------------------------

Old:
----
  getmail-5.5.tar.gz

New:
----
  getmail-5.6.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ getmail.spec ++++++
--- /var/tmp/diff_new_pack.cg6Bry/_old  2018-05-11 14:28:01.268645581 +0200
+++ /var/tmp/diff_new_pack.cg6Bry/_new  2018-05-11 14:28:01.272645436 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package getmail
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           getmail
-Version:        5.5
+Version:        5.6
 Release:        0
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Url:            http://pyropus.ca/software/getmail/

++++++ _service ++++++
--- /var/tmp/diff_new_pack.cg6Bry/_old  2018-05-11 14:28:01.312643983 +0200
+++ /var/tmp/diff_new_pack.cg6Bry/_new  2018-05-11 14:28:01.316643837 +0200
@@ -1,7 +1,7 @@
 <services>
 <service name="verify_file" mode="localonly">
   <param name="verifier">sha256</param>
-  <param 
name="checksum">e0382ee59f1ec6ac2d6f01b71ca71db0826db0d267704b2bc2d97b9beda28350</param>
-  <param name="file">getmail-5.5.tar.gz</param>
+  <param 
name="checksum">460d2c8834936df88d594095d789c4585edca9b0bdbeded9f6267f0d90dcd59a</param>
+  <param name="file">getmail-5.6.tar.gz</param>
 </service>
 </services>

++++++ getmail-5.5.tar.gz -> getmail-5.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-5.5/PKG-INFO new/getmail-5.6/PKG-INFO
--- old/getmail-5.5/PKG-INFO    2017-12-18 22:56:09.000000000 +0100
+++ new/getmail-5.6/PKG-INFO    2018-04-02 23:48:11.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: getmail
-Version: 5.5
+Version: 5.6
 Summary: a mail retrieval, sorting, and delivering system
 Home-page: http://pyropus.ca/software/getmail/
 Author: Charles Cazabon
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-5.5/README new/getmail-5.6/README
--- old/getmail-5.5/README      2009-08-07 00:20:45.000000000 +0200
+++ new/getmail-5.6/README      2018-04-02 23:47:38.000000000 +0200
@@ -1,4 +1,4 @@
-getmail version 4 -- a flexible, extensible mail retrieval system with
+getmail version 5 -- a flexible, extensible mail retrieval system with
 support for POP3, IMAP4, SSL variants of both, maildirs, mboxrd files,
 external MDAs, arbitrary message filtering, single-user and domain-mailboxes,
 and many other useful features.
@@ -7,11 +7,11 @@
 getmail is licensed for use under the GNU General Public License version 2
 (only).  See docs/COPYING for specific terms and distribution information.
 
-getmail version 4 requires Python version 2.3.3 or later.  You can have
+getmail version 5 requires Python version 2.3.3 or later.  You can have
 several installed versions of Python peacefully co-existing, see
 python.org for details.
 
-To install:  getmail v.4 uses the standard Python distutils.  Do the following
+To install:  getmail v.5 uses the standard Python distutils.  Do the following
   as a regular user:
 
     python setup.py build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-5.5/docs/CHANGELOG 
new/getmail-5.6/docs/CHANGELOG
--- old/getmail-5.5/docs/CHANGELOG      2017-12-18 22:55:58.000000000 +0100
+++ new/getmail-5.6/docs/CHANGELOG      2018-04-02 23:47:38.000000000 +0200
@@ -1,3 +1,8 @@
+Version 5.6
+02 April 2018
+    -fix references to version 4 in README.  Thanks: Daniel Kahn Gillmor.
+    -add Gmail-specific XOAUTH2 login support for IMAP.  Thanks: Stefan Krah.
+
 Version 5.5
 18 December 2017
     -feature request: added record_mailbox configuration parameter, to allow
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-5.5/docs/THANKS new/getmail-5.6/docs/THANKS
--- old/getmail-5.5/docs/THANKS 2006-01-27 18:13:32.000000000 +0100
+++ new/getmail-5.6/docs/THANKS 2018-04-02 23:47:38.000000000 +0200
@@ -1,5 +1,5 @@
 I would like to thank the following individuals and organizations
-for their gracious contributions to the development of getmail version 4.
+for their gracious contributions to the development of getmail version 4 and 5.
 
 getmail 4 sponsors
 ------------------
@@ -37,3 +37,5 @@
 Klinikum Landsberg of Germany
 
 
+Also see the CHANGELOG for thanks to individual contributors for bug reports,
+bug fixes, feature patches, and other contributions.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-5.5/docs/configuration.html 
new/getmail-5.6/docs/configuration.html
--- old/getmail-5.5/docs/configuration.html     2017-12-18 22:56:07.000000000 
+0100
+++ new/getmail-5.6/docs/configuration.html     2018-04-02 23:48:09.000000000 
+0200
@@ -570,7 +570,7 @@
         via the keychain.  See <a 
href="http://article.gmane.org/gmane.mail.getmail.user/5120";>this
         posting to the getmail users' mailing list by Alan Schmitt</a> for 
details.
     </li>
-    <li>
+    <li id="password_command">
         password_command
         (<a href="#parameter-tuplestrings">tuple of quoted strings</a>)
         &mdash; retrieve the account password by running an arbitrary external 
@@ -656,6 +656,24 @@
         <a 
href="http://honk.sigxcpu.org/projects/pykerberos/";>http://honk.sigxcpu.org/projects/pykerberos/";</a>
         for details.
     </li>
+    <li>
+        use_xoauth2
+        (<a href="#parameter-boolean">boolean</a>)
+        &mdash; whether to use XOAUTH2 for login with the IMAP server.
+        If not set, normal password-based authenticaion is used.  This is
+        currently only supported with Gmail; if anyone extends this to support
+        other IMAP providers, please let me know so I can include such support
+        in getmail.  <strong>Note that using XOAUTH2 is no more secure than a
+        regular getmail configuration with a mode 0600 getmailrc file</strong>.
+        You will need to set <a href="#password_command">password_command</a>
+        as well to tell getmail to invoke the getmail-gmail-xoauth-tokens
+        helper program; that script requires a positional argument to tell it
+        where to read the initial tokens from and where it writes the access
+        and refresh tokens to, and the file requires manual initial setup.
+        This functionality was contributed by Stefan Krah, who has
+        <a href="http://www.bytereef.org/howto/oauth2/getmail.html";>additional
+        information about using it here</a>.
+    </li>
 </ul>
 
 <h4 id="retriever-ssl-client">SSL Client Parameters</h4>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-5.5/docs/configuration.txt 
new/getmail-5.6/docs/configuration.txt
--- old/getmail-5.5/docs/configuration.txt      2017-12-18 22:56:08.000000000 
+0100
+++ new/getmail-5.6/docs/configuration.txt      2018-04-02 23:48:10.000000000 
+0200
@@ -418,6 +418,19 @@
        pykerberos with GSS support is installed; check your OS
        distribution or see http://honk.sigxcpu.org/projects/pykerberos/";
        for details.
+     * use_xoauth2 (boolean) — whether to use XOAUTH2 for login with the
+       IMAP server. If not set, normal password-based authenticaion is
+       used. This is currently only supported with Gmail; if anyone
+       extends this to support other IMAP providers, please let me know so
+       I can include such support in getmail. Note that using XOAUTH2 is
+       no more secure than a regular getmail configuration with a mode
+       0600 getmailrc file. You will need to set password_command as well
+       to tell getmail to invoke the getmail-gmail-xoauth-tokens helper
+       program; that script requires a positional argument to tell it
+       where to read the initial tokens from and where it writes the
+       access and refresh tokens to, and the file requires manual initial
+       setup. This functionality was contributed by Stefan Krah, who has
+       additional information about using it here.
 
 SSL Client Parameters
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-5.5/getmail-gmail-xoauth-tokens 
new/getmail-5.6/getmail-gmail-xoauth-tokens
--- old/getmail-5.5/getmail-gmail-xoauth-tokens 1970-01-01 01:00:00.000000000 
+0100
+++ new/getmail-5.6/getmail-gmail-xoauth-tokens 2018-04-02 23:47:38.000000000 
+0200
@@ -0,0 +1,117 @@
+#!/usr/bin/env python
+
+#
+# Copyright 2012 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+     # http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#
+# Derived from oauth2.py (https://github.com/google/gmail-oauth2-tools).
+# Heavily modified and rewritten by Stefan Krah.
+#
+
+
+import os
+import sys
+import urllib
+import json
+import argparse
+import time
+
+
+class OAuth2(object):
+
+    def __init__(self, token_data_path):
+        self.token_data_path = token_data_path
+
+        with open(self.token_data_path) as f:
+            self.data = json.load(f)
+
+    def copy(self, *keys):
+        data = {}
+        for k in keys:
+            data[k] = self.data[k]
+        return data
+
+    def query(self, params):
+        lst = []
+        for param in sorted(params.iteritems(), key=lambda x: x[0]):
+            escaped = urllib.quote(param[1], safe='~-._')
+            lst.append('%s=%s' % (param[0], escaped))
+        return '&'.join(lst)
+
+    def code_url(self):
+        params = self.copy('scope', 'client_id', 'redirect_uri')
+        params['response_type'] = 'code'
+        return '%s?%s' % (self.data['auth_uri'], self.query(params))
+
+    def get_response(self, url, params):
+        encoded = urllib.urlencode(params)
+        response = urllib.urlopen(url, encoded).read()
+        return json.loads(response)
+
+    def update_config(self, d):
+        self.data['access_token'] = d['access_token']
+        self.data['expires_at'] = time.time() + d['expires_in'] - 100
+
+        refresh_token = d.get('refresh_token')
+        if refresh_token is not None:
+            self.data['refresh_token'] = refresh_token
+
+        with open(self.token_data_path, "w") as f:
+            json.dump(self.data, f)
+
+    def init_tokens(self, code):
+        params = self.copy('user', 'client_id', 'client_secret',
+                           'redirect_uri')
+        params['code'] = code
+        params['grant_type'] = 'authorization_code'
+
+        d = self.get_response(self.data['token_uri'], params)
+        self.update_config(d)
+
+    def refresh_tokens(self):
+        params = self.copy('client_id', 'client_secret', 'refresh_token')
+        params['grant_type'] = 'refresh_token'
+
+        d = self.get_response(self.data['token_uri'], params)
+        self.update_config(d)
+
+    def token(self):
+        if time.time() >= self.data.get('expires_at'):
+            self.refresh_tokens()
+
+        return self.data['access_token']
+
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser()
+    parser.add_argument("-i", "--init", action="store_true", default=False,
+                        help="initialize access and refresh tokens")
+    parser.add_argument('tokenfile', metavar='<token data file path>',
+                        help="location of the token data file")
+
+    args = parser.parse_args()
+    auth = OAuth2(args.tokenfile)
+
+    if args.init:
+        print "Visit this url to obtain a verification code:"
+        print "    %s\n" % auth.code_url()
+
+        code = raw_input("Enter verification code: ")
+        response = auth.init_tokens(code)
+    else:
+        sys.stdout.write("%s" % auth.token())
+
+    sys.exit(0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-5.5/getmail.spec new/getmail-5.6/getmail.spec
--- old/getmail-5.5/getmail.spec        2017-12-18 22:56:08.000000000 +0100
+++ new/getmail-5.6/getmail.spec        2018-04-02 23:48:10.000000000 +0200
@@ -2,7 +2,7 @@
 
 Summary: POP3 mail retriever with reliable Maildir delivery
 Name: getmail
-Version: 5.5
+Version: 5.6
 Release: 1
 License: GPL
 Group: Applications/Internet
@@ -52,6 +52,21 @@
 %{python_sitelib}/getmailcore/
 
 %changelog
+* Mon Apr 02 2018 Charles Cazabon <[email protected]>
+-update to version 5.6
+
+* Mon Apr 02 2018 Charles Cazabon <[email protected]>
+-update to version 5.6
+
+* Mon Apr 02 2018 Charles Cazabon <[email protected]>
+-update to version 5.6
+
+* Mon Apr 02 2018 Charles Cazabon <[email protected]>
+-update to version 5.6
+
+* Mon Apr 02 2018 Charles Cazabon <[email protected]>
+-update to version 5.6
+
 * Mon Dec 18 2017 Charles Cazabon <[email protected]>
 -update to version 5.5
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-5.5/getmailcore/__init__.py 
new/getmail-5.6/getmailcore/__init__.py
--- old/getmail-5.5/getmailcore/__init__.py     2017-12-18 22:55:58.000000000 
+0100
+++ new/getmail-5.6/getmailcore/__init__.py     2018-04-02 23:47:38.000000000 
+0200
@@ -16,7 +16,7 @@
     raise ImportError('getmail version 4 requires Python version 2.3.3'
                       ' or later')
 
-__version__ = '5.5'
+__version__ = '5.6'
 
 __all__ = [
     'baseclasses',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-5.5/getmailcore/_retrieverbases.py 
new/getmail-5.6/getmailcore/_retrieverbases.py
--- old/getmail-5.5/getmailcore/_retrieverbases.py      2017-12-18 
22:22:56.000000000 +0100
+++ new/getmail-5.6/getmailcore/_retrieverbases.py      2018-04-02 
23:47:38.000000000 +0200
@@ -1695,6 +1695,11 @@
                         'login_cram_md5', self.conf['username'],
                         self.conf['password']
                     )
+                elif self.conf['use_xoauth2']:
+                    # octal 1 / ctrl-A used as separator
+                    auth = 'user=%s\1auth=Bearer %s\1\1' % 
(self.conf['username'],
+                                                            
self.conf['password'])
+                    self.conn.authenticate('XOAUTH2', lambda unused: auth)
                 else:
                     self._parse_imapcmdresponse('login', self.conf['username'],
                                                 self.conf['password'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-5.5/getmailcore/retrievers.py 
new/getmail-5.6/getmailcore/retrievers.py
--- old/getmail-5.5/getmailcore/retrievers.py   2017-12-18 22:22:56.000000000 
+0100
+++ new/getmail-5.6/getmailcore/retrievers.py   2018-04-02 23:47:38.000000000 
+0200
@@ -388,6 +388,7 @@
         # .authenticate(), so we can't do this yet (?).
         ConfBool(name='use_cram_md5', required=False, default=False),
         ConfBool(name='use_kerberos', required=False, default=False),
+        ConfBool(name='use_xoauth2', required=False, default=False),
     )
     received_from = None
     received_with = 'IMAP4'
@@ -437,6 +438,7 @@
         # .authenticate(), so we can't do this yet (?).
         ConfBool(name='use_cram_md5', required=False, default=False),
         ConfBool(name='use_kerberos', required=False, default=False),
+        ConfBool(name='use_xoauth2', required=False, default=False),
         ConfString(name='ssl_cert_hostname', required=False, default=None),
     )
     received_from = None
@@ -479,6 +481,7 @@
         # .authenticate(), so we can't do this yet (?).
         ConfBool(name='use_cram_md5', required=False, default=False),
         ConfBool(name='use_kerberos', required=False, default=False),
+        ConfBool(name='use_xoauth2', required=False, default=False),
         ConfString(name='envelope_recipient'),
     )
     received_from = None
@@ -529,6 +532,7 @@
         # .authenticate(), so we can't do this yet (?).
         ConfBool(name='use_cram_md5', required=False, default=False),
         ConfBool(name='use_kerberos', required=False, default=False),
+        ConfBool(name='use_xoauth2', required=False, default=False),
         ConfString(name='envelope_recipient'),
         ConfString(name='ssl_cert_hostname', required=False, default=None),
     )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-5.5/setup.py new/getmail-5.6/setup.py
--- old/getmail-5.5/setup.py    2007-11-23 17:26:55.000000000 +0100
+++ new/getmail-5.6/setup.py    2018-04-02 23:47:38.000000000 +0200
@@ -92,10 +92,11 @@
         'getmailcore'
     ],
     scripts=[
-    'getmail',
-    'getmail_fetch',
-    'getmail_maildir',
-    'getmail_mbox'
+        'getmail',
+        'getmail_fetch',
+        'getmail_maildir',
+        'getmail_mbox',
+        'getmail-gmail-xoauth-tokens',
     ],
     data_files=[
         (GETMAILDOCDIR, [


Reply via email to