Hello community,

here is the log from the commit of package getmail for openSUSE:Factory checked 
in at 2012-02-20 16:10:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/getmail (Old)
 and      /work/SRC/openSUSE:Factory/.getmail.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "getmail", Maintainer is ""

Changes:
--------
--- /work/SRC/openSUSE:Factory/getmail/getmail.changes  2011-12-12 
17:00:40.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.getmail.new/getmail.changes     2012-02-20 
16:10:42.000000000 +0100
@@ -1,0 +2,6 @@
+Sat Feb 11 17:19:20 UTC 2012 - [email protected]
+
+- update to 4.25.0:
+  * add support for storing POP/IMAP password in OSX keychain
+
+-------------------------------------------------------------------

Old:
----
  getmail-4.24.0.tar.gz

New:
----
  getmail-4.25.0.tar.gz

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

Other differences:
------------------
++++++ getmail.spec ++++++
--- /var/tmp/diff_new_pack.8WEhia/_old  2012-02-20 16:10:43.000000000 +0100
+++ /var/tmp/diff_new_pack.8WEhia/_new  2012-02-20 16:10:43.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package getmail
 #
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 
 
 Name:           getmail
-Version:        4.24.0
+Version:        4.25.0
 Release:        1
 Group:          Productivity/Networking/Email/Utilities
 License:        GPL-2.0

++++++ getmail-4.24.0.tar.gz -> getmail-4.25.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-4.24.0/PKG-INFO new/getmail-4.25.0/PKG-INFO
--- old/getmail-4.24.0/PKG-INFO 2011-12-12 01:16:13.000000000 +0100
+++ new/getmail-4.25.0/PKG-INFO 2012-02-01 22:38:10.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: getmail
-Version: 4.24.0
+Version: 4.25.0
 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-4.24.0/docs/CHANGELOG 
new/getmail-4.25.0/docs/CHANGELOG
--- old/getmail-4.24.0/docs/CHANGELOG   2011-12-12 01:16:05.000000000 +0100
+++ new/getmail-4.25.0/docs/CHANGELOG   2012-02-01 22:37:20.000000000 +0100
@@ -1,3 +1,8 @@
+Version 4.25.0
+1 February 2012
+    -add support for storing POP/IMAP password in OSX keychain.  Thanks: Adam 
+    Lazur.
+
 Version 4.24.0
 11 December 2011
     -add an explicit expunge when closing an IMAP mailbox, for servers that 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-4.24.0/getmail.spec 
new/getmail-4.25.0/getmail.spec
--- old/getmail-4.24.0/getmail.spec     2011-12-12 01:16:11.000000000 +0100
+++ new/getmail-4.25.0/getmail.spec     2012-02-01 22:38:08.000000000 +0100
@@ -2,7 +2,7 @@
 
 Summary: POP3 mail retriever with reliable Maildir delivery
 Name: getmail
-Version: 4.24.0
+Version: 4.25.0
 Release: 1
 License: GPL
 Group: Applications/Internet
@@ -52,6 +52,15 @@
 %{python_sitelib}/getmailcore/
 
 %changelog
+* Wed Feb 01 2012 Charles Cazabon <[email protected]>
+-update to version 4.25.0
+
+* Tue Jan 03 2012 Charles Cazabon <[email protected]>
+-update to version 4.25.0
+
+* Tue Jan 03 2012 Charles Cazabon <[email protected]>
+-update to version 4.25.0
+
 * Sun Dec 11 2011 Charles Cazabon <[email protected]>
 -update to version 4.24.0
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-4.24.0/getmailcore/__init__.py 
new/getmail-4.25.0/getmailcore/__init__.py
--- old/getmail-4.24.0/getmailcore/__init__.py  2011-12-12 01:16:05.000000000 
+0100
+++ new/getmail-4.25.0/getmailcore/__init__.py  2012-01-03 18:00:59.000000000 
+0100
@@ -16,7 +16,7 @@
     raise ImportError('getmail version 4 requires Python version 2.3.3'
                       ' or later')
 
-__version__ = '4.24.0'
+__version__ = '4.25.0'
 
 __all__ = [
     'baseclasses',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-4.24.0/getmailcore/_retrieverbases.py 
new/getmail-4.25.0/getmailcore/_retrieverbases.py
--- old/getmail-4.24.0/getmailcore/_retrieverbases.py   2011-12-12 
01:16:05.000000000 +0100
+++ new/getmail-4.25.0/getmailcore/_retrieverbases.py   2012-01-03 
18:00:59.000000000 +0100
@@ -38,7 +38,6 @@
 import os
 import socket
 import time
-import getpass
 import email
 import poplib
 import imaplib
@@ -655,8 +654,9 @@
         self.log.trace()
         # Handle password
         if self.conf.get('password', None) is None:
-            self.conf['password'] = getpass.getpass(
-                'Enter password for %s:  ' % self
+            self.conf['password'] = get_password(
+                self, self.conf['username'], self.conf['server'], 'pop3', 
+                self.log
             )
         RetrieverSkeleton.initialize(self, options)
         try:
@@ -1025,9 +1025,11 @@
         # Handle password
         if (self.conf.get('password', None) is None
                 and not (HAVE_KERBEROS_GSS and self.conf['use_kerberos'])):
-            self.conf['password'] = getpass.getpass(
-                'Enter password for %s:  ' % self
+            self.conf['password'] = get_password(
+                self, self.conf['username'], self.conf['server'], 'imap',
+                self.log
             )
+            
         RetrieverSkeleton.initialize(self, options)
         try:
             self.log.trace('trying self._connect()' + os.linesep)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/getmail-4.24.0/getmailcore/utilities.py 
new/getmail-4.25.0/getmailcore/utilities.py
--- old/getmail-4.24.0/getmailcore/utilities.py 2008-09-26 21:13:07.000000000 
+0200
+++ new/getmail-4.25.0/getmailcore/utilities.py 2012-02-01 22:37:20.000000000 
+0100
@@ -20,6 +20,7 @@
     'gid_of_uid',
     'uid_of_user',
     'updatefile',
+    'get_password',
 ]
 
 
@@ -30,10 +31,12 @@
 import stat
 import time
 import glob
-
+import re
 import fcntl
 import pwd
 import grp
+import getpass
+import commands
 
 from getmailcore.exceptions import *
 
@@ -48,6 +51,8 @@
     'off'   : False,
     '0'     : False
 }
+osx_keychain_binary = '/usr/bin/security'
+
 
 #######################################
 def lock_file(file, locktype):
@@ -469,3 +474,44 @@
             'optional certfile and keyfile must be supplied together'
         )
     return (keyfile, certfile)
+
+
+#######################################
+if os.name == 'posix' and os.path.isfile(osx_keychain_binary):
+    def keychain_password(user, server, protocol, logger):
+        """Mac OSX: return a keychain password, if it exists.  Otherwise, 
return
+        None.
+        """
+        # wish we could pass along a comment to this thing for the user prompt
+        cmd = "%s find-internet-password -g -a '%s' -s '%s' -r '%s'" % (
+            osx_keychain_binary, user, server, protocol
+        )
+        (status, output) = commands.getstatusoutput(cmd)
+        if status != os.EX_OK or not output:
+            logger.error('keychain command %s failed: %s %s' 
+                         % (cmd, status, output))
+            return None
+        password = None
+        for line in output.split('\n'):
+            match = re.match(r'password: "([^"]+)"', line)
+            if match:
+                password = match.group(1)
+        if password is None:
+            logger.debug('No keychain password found for %s %s %s'
+                         % (user, server, protocol))
+        return password
+else:
+    def keychain_password(user, server, protocol, logger):
+        """Not Mac OSX: always return None.
+        """
+        return None
+
+
+#######################################
+def get_password(label, user, server, protocol, logger):
+    # try keychain first
+    password = keychain_password(user, server, protocol, logger)
+    # if no password found (or not on OSX), prompt in the usual way
+    if not password:
+        password = getpass.getpass('Enter password for %s:  ' % label)
+    return password

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to