[-]
[+]
|
Changed |
getmail.changes
|
|
[-]
[+]
|
Changed |
getmail.spec
^
|
|
[-]
[+]
|
Changed |
getmail-4.34.0.tar.bz2/PKG-INFO
^
|
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: getmail
-Version: 4.30.1
+Version: 4.34.0
Summary: a mail retrieval, sorting, and delivering system
Home-page: http://pyropus.ca/software/getmail/
Author: Charles Cazabon
|
[-]
[+]
|
Changed |
getmail-4.34.0.tar.bz2/docs/CHANGELOG
^
|
@@ -1,3 +1,34 @@
+Version 4.34.0
+8 September 2012
+ -retrieve Gmail metadata (labels, thread ID, message ID) via IMAP extension
+ and record it in new message headers. Thanks: Krzysztof Warzecha.
+
+Version 4.33.0
+7 August 2012
+ -allow normal exit on interrupt (ctrl-c) to allow the user to abort message
+ retrieval while still remembering already-retrieved messages as successfully
+ delivered. You may get a weird error message after you abort, since the
+ server may be in the middle of delivering another message to getmail at the
+ time. Thanks: Krzysztof Warzecha.
+
+Version 4.32.0
+6 July 2012
+ -prevent some nuisance stack traces if getmail cannot connect to the POP/
+ IMAP server correctly. Thanks: Daniel Dumke.
+ -restore use_peek IMAP retriever parameter which accidentally got removed
+ in 4.30. Thanks: Andreas Amann.
+
+Version 4.31.0
+5 July 2012
+ -improved backwards compatibility with pre-v.4.22.0 oldmail files, so IMAP
+ mail is not re-retrieved if you upgrade from a 4.22 or earlier to this one;
+ no user action necessary. Thanks: Osamu Aoki, Tim van der Molen.
+
+Version 4.30.2
+27 June 2012
+ -fix a nuisance stack trace that would be dumped if a connection failed in
+ particular states. Thanks: Gary Schmidt.
+
Version 4.30.1
21 June 2012
-silence a nuisance deprecation warning about the sets module when running
|
[-]
[+]
|
Changed |
getmail-4.34.0.tar.bz2/docs/faq.html
^
|
@@ -168,6 +168,11 @@
<li><a href="faq.html#faq-integrating-procmail">How do I use procmail with getmail?</a></li>
<li><a href="faq.html#faq-integrating-maildrop">How do I use maildrop with getmail?</a></li>
<li><a href="faq.html#faq-integrating-tmda">How do I use TMDA with getmail?</a></li>
+ <li>
+ <ul>
+ <li><a href="faq.html#faq-integrating-gmail">How can I get Gmail labels with getmail?</a></li>
+ </ul>
+ </li>
</ul>
</li>
<li><a href="faq.html#faq-notabug">I think I found this bug in getmail …</a></li>
@@ -1571,6 +1576,16 @@
<a href="configuration.html#conf-filters-tmda">Filter_TMDA module</a>.
</p>
+<h4 id="faq-integrating-gmail">How can I get Gmail labels with getmail?</h4>
+<p>
+ As of getmail version 4.34.0, getmail retrieves the labels and other metadata
+ that Gmail makes available via an IMAP extension, and records that information
+ in the message headers
+ <span class="file">X-GMAIL-LABELS:</span>,
+ <span class="file">X-GMAIL-THRID:</span>,
+ and <span class="file">X-GMAIL-MSGID:</span>.
+</p>
+
<!-- ********************************************************************** -->
<h2 id="faq-notabug">I think I found this bug in getmail …</h2>
<p>
|
[-]
[+]
|
Changed |
getmail-4.34.0.tar.bz2/docs/faq.txt
^
|
@@ -939,6 +939,13 @@
See the documentation for details on optional parameters to the
Filter_TMDA module.
+ How can I get Gmail labels with getmail?
+
+ As of getmail version 4.34.0, getmail retrieves the labels and other
+ metadata that Gmail makes available via an IMAP extension, and records
+ that information in the message headers X-GMAIL-LABELS:, X-GMAIL-THRID:,
+ and X-GMAIL-MSGID:.
+
I think I found this bug in getmail ...
I get frequent reports like the following, which aren't bugs in getmail.
|
[-]
[+]
|
Changed |
getmail-4.34.0.tar.bz2/getmail
^
|
@@ -269,6 +269,11 @@
except StopIteration:
pass
+ except KeyboardInterrupt, o:
+ log.warning('%s: user aborted\n' % configfile)
+ if options['logfile']:
+ options['logfile'].write('user aborted')
+
except socket.timeout, o:
errorexit = True
retriever.abort()
|
[-]
[+]
|
Changed |
getmail-4.34.0.tar.bz2/getmail.spec
^
|
@@ -2,7 +2,7 @@
Summary: POP3 mail retriever with reliable Maildir delivery
Name: getmail
-Version: 4.30.1
+Version: 4.34.0
Release: 1
License: GPL
Group: Applications/Internet
@@ -52,6 +52,21 @@
%{python_sitelib}/getmailcore/
%changelog
+* Sat Sep 08 2012 Charles Cazabon <charlesc-getmail-rpm@pyropus.ca>
+-update to version 4.34.0
+
+* Tue Aug 07 2012 Charles Cazabon <charlesc-getmail-rpm@pyropus.ca>
+-update to version 4.33.0
+
+* Fri Jul 06 2012 Charles Cazabon <charlesc-getmail-rpm@pyropus.ca>
+-update to version 4.32.0
+
+* Thu Jul 05 2012 Charles Cazabon <charlesc-getmail-rpm@pyropus.ca>
+-update to version 4.31.0
+
+* Wed Jun 27 2012 Charles Cazabon <charlesc-getmail-rpm@pyropus.ca>
+-update to version 4.30.2
+
* Thu Jun 21 2012 Charles Cazabon <charlesc-getmail-rpm@pyropus.ca>
-update to version 4.30.1
|
[-]
[+]
|
Changed |
getmail-4.34.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.30.1'
+__version__ = '4.34.0'
__all__ = [
'baseclasses',
|
[-]
[+]
|
Changed |
getmail-4.34.0.tar.bz2/getmailcore/_retrieverbases.py
^
|
@@ -138,6 +138,7 @@
self.log.trace('POP3 connection %s established' % self.conn
+ os.linesep)
+
#######################################
class Py24POP3SSLinitMixIn(object):
'''Mix-In class to do POP3 over SSL initialization with Python 2.4's
@@ -184,6 +185,7 @@
self.log.trace('POP3 connection %s established' % self.conn
+ os.linesep)
+
#######################################
class Py23POP3SSLinitMixIn(object):
'''Mix-In class to do POP3 over SSL initialization with custom-implemented
@@ -230,6 +232,7 @@
self.log.trace('POP3 SSL connection %s established' % self.conn
+ os.linesep)
+
#######################################
class IMAPinitMixIn(object):
'''Mix-In class to do IMAP non-SSL initialization.
@@ -378,6 +381,7 @@
self.__initialized = False
self.gotmsglist = False
self._clear_state()
+ self.conn = None
ConfigurableBase.__init__(self, **args)
def _clear_state(self):
@@ -469,6 +473,13 @@
continue
try:
(msgid, timestamp) = line.split('\0', 1)
+ if msgid.count('/') == 2:
+ # Was pre-4.22.0 file format, which includes the
+ # mailbox name in the msgid, in the format
+ # 'uidvalidity/mailbox/serveruid'.
+ # Strip it out.
+ fields = msgid.split('/')
+ msgid = '/'.join([fields[0], fields[2]])
self.oldmail[msgid] = int(timestamp)
except ValueError:
# malformed
@@ -579,6 +590,7 @@
self._delmsgbyid(msgid)
self.deleted[msgid] = True
+
#######################################
class POP3RetrieverBase(RetrieverSkeleton):
'''Base class for single-user POP3 mailboxes.
@@ -739,25 +751,28 @@
def abort(self):
self.log.trace()
RetrieverSkeleton.abort(self)
+ if not self.conn:
+ return
try:
self.conn.rset()
self.conn.quit()
except (poplib.error_proto, socket.error), o:
pass
- del self.conn
+ self.conn = None
def quit(self):
RetrieverSkeleton.quit(self)
self.log.trace()
- if not getattr(self, 'conn', None):
+ if not self.conn:
return
try:
self.conn.quit()
- self.conn = None
except (poplib.error_proto, socket.error), o:
raise getmailOperationError('POP error (%s)' % o)
except AttributeError:
pass
+ self.conn = None
+
#######################################
class MultidropPOP3RetrieverBase(POP3RetrieverBase):
@@ -819,6 +834,7 @@
msg.recipient = address_no_brackets(line.strip())
return msg
+
#######################################
class IMAPRetrieverBase(RetrieverSkeleton):
'''Base class for single-user IMAP mailboxes.
@@ -1128,18 +1144,73 @@
# response[0] is None instead of a message tuple
raise getmailRetrievalError('failed to retrieve msgid %s'
% msgid)
+
+ # google extensions: apply labels, etc
+ if 'X-GM-EXT-1' in self.conn.capabilities:
+ metadata = self._getgmailmetadata(uid, msg)
+ for (header, value) in metadata.items():
+ msg.add_header(header, value)
+
return msg
except imaplib.IMAP4.error, o:
raise getmailOperationError('IMAP error (%s)' % o)
+ def _getgmailmetadata(self, uid, msg):
+ """
+ Add Gmail labels and other metadata which Google exposes through an
+ IMAP extension to headers in the message.
+
+ See https://developers.google.com/google-apps/gmail/imap_extensions
+ """
+ try:
+ # ['976 (X-GM-THRID 1410134259107225671 X-GM-MSGID '
+ # '1410134259107225671 X-GM-LABELS (labels space '
+ # 'separated) UID 167669)']
+ response = self._parse_imapuidcmdresponse('FETCH', uid,
+ '(X-GM-LABELS X-GM-THRID X-GM-MSGID)')
+ except imaplib.IMAP4.error, o:
+ self.log.warning('Could not fetch google imap extensions: %s' % o)
+ return {}
+
+ if not response:
+ return {}
+
+ ext = re.search(
+ 'X-GM-THRID (?P<THRID>\d+) X-GM-MSGID (?P<MSGID>\d+)'
+ ' X-GM-LABELS \((?P<LABELS>.*)\) UID',
+ response[0]
+ )
+ if not ext:
+ self.log.warning(
+ 'Could not parse google imap extensions. Server said: %s'
+ % repr(response)
+ )
+ return ()
+
+ results = ext.groupdict()
+ metadata = {}
+ for item in ('LABELS', 'THRID', 'MSGID'):
+ if item in results and results[item]:
+ metadata['X-GMAIL-%s' % item] = results[item]
+
+ return metadata
+
def _getmsgbyid(self, msgid):
self.log.trace()
- return self._getmsgpartbyid(msgid, '(BODY.PEEK[])')
+ if self.conf.get('use_peek', True):
+ part = '(BODY.PEEK[])'
+ else:
+ part = '(RFC822)'
+ return self._getmsgpartbyid(msgid, part)
def _getheaderbyid(self, msgid):
self.log.trace()
- return self._getmsgpartbyid(msgid, '(BODY.PEEK[header])')
+ if self.conf.get('use_peek', True):
+ part = '(BODY.PEEK[header])'
+ else:
+ part = '(RFC822[header])'
+ return self._getmsgpartbyid(msgid, part)
def initialize(self, options):
self.log.trace()
@@ -1203,14 +1274,17 @@
def abort(self):
self.log.trace()
RetrieverSkeleton.abort(self)
+ if not self.conn:
+ return
try:
self.quit()
except (imaplib.IMAP4.error, socket.error), o:
pass
+ self.conn = None
def quit(self):
self.log.trace()
- if not getattr(self, 'conn', None):
+ if not self.conn:
return
try:
if self.mailbox_selected is not False:
@@ -1221,11 +1295,12 @@
self.conn.expunge()
self.conn.close()
self.conn.logout()
- self.conn = None
except imaplib.IMAP4.error, o:
#raise getmailOperationError('IMAP error (%s)' % o)
self.log.warning('IMAP error during logout (%s)' % o + os.linesep)
RetrieverSkeleton.quit(self)
+ self.conn = None
+
#######################################
class MultidropIMAPRetrieverBase(IMAPRetrieverBase):
|