[-]
[+]
|
Changed |
getmail.changes
|
|
[-]
[+]
|
Changed |
getmail.spec
^
|
|
[-]
[+]
|
Changed |
getmail-4.26.0.tar.bz2/PKG-INFO
^
|
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: getmail
-Version: 4.24.0
+Version: 4.26.0
Summary: a mail retrieval, sorting, and delivering system
Home-page: http://pyropus.ca/software/getmail/
Author: Charles Cazabon
|
[-]
[+]
|
Changed |
getmail-4.26.0.tar.bz2/docs/CHANGELOG
^
|
@@ -1,3 +1,15 @@
+Version 4.26.0
+14 April 2012
+ -switch to using BODY.PEEK in IMAP retrieval; I no longer see problems with
+ this feature in my testing. If users experience incompatibility with any
+ IMAP servers where 4.25.0 worked, please let me know.
+
+
+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
|
[-]
[+]
|
Changed |
getmail-4.26.0.tar.bz2/getmail.spec
^
|
@@ -2,7 +2,7 @@
Summary: POP3 mail retriever with reliable Maildir delivery
Name: getmail
-Version: 4.24.0
+Version: 4.26.0
Release: 1
License: GPL
Group: Applications/Internet
@@ -52,6 +52,18 @@
%{python_sitelib}/getmailcore/
%changelog
+* Sat Apr 14 2012 Charles Cazabon <charlesc-getmail-rpm@pyropus.ca>
+-update to version 4.26.0
+
+* Wed Feb 01 2012 Charles Cazabon <charlesc-getmail-rpm@pyropus.ca>
+-update to version 4.25.0
+
+* Tue Jan 03 2012 Charles Cazabon <charlesc-getmail-rpm@pyropus.ca>
+-update to version 4.25.0
+
+* Tue Jan 03 2012 Charles Cazabon <charlesc-getmail-rpm@pyropus.ca>
+-update to version 4.25.0
+
* Sun Dec 11 2011 Charles Cazabon <charlesc-getmail-rpm@pyropus.ca>
-update to version 4.24.0
|
[-]
[+]
|
Changed |
getmail-4.26.0.tar.bz2/getmailcore/__init__.py
^
|
@@ -16,7 +16,7 @@
raise ImportError('getmail version 4 requires Python version 2.3.3'
' or later')
-__version__ = '4.24.0'
+__version__ = '4.26.0'
__all__ = [
'baseclasses',
|
[-]
[+]
|
Changed |
getmail-4.26.0.tar.bz2/getmailcore/_retrieverbases.py
^
|
@@ -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:
@@ -1014,20 +1014,22 @@
def _getmsgbyid(self, msgid):
self.log.trace()
- return self._getmsgpartbyid(msgid, '(RFC822)')
+ return self._getmsgpartbyid(msgid, '(BODY.PEEK[])')
def _getheaderbyid(self, msgid):
self.log.trace()
- return self._getmsgpartbyid(msgid, '(RFC822[header])')
+ return self._getmsgpartbyid(msgid, '(BODY.PEEK[header])')
def initialize(self, options):
self.log.trace()
# 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)
|
[-]
[+]
|
Changed |
getmail-4.26.0.tar.bz2/getmailcore/utilities.py
^
|
@@ -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
|