Hello community, here is the log from the commit of package getmail for openSUSE:Factory checked in at 2013-10-01 08:12:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/getmail (Old) and /work/SRC/openSUSE:Factory/.getmail.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "getmail" Changes: -------- --- /work/SRC/openSUSE:Factory/getmail/getmail.changes 2013-08-10 18:28:25.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.getmail.new/getmail.changes 2013-10-01 08:12:17.000000000 +0200 @@ -1,0 +2,7 @@ +Mon Sep 23 07:13:10 UTC 2013 - [email protected] + +- update to 4.43.0: + + add IMAP IDLE support +- refreshed getmail-fix_paths.patch + +------------------------------------------------------------------- Old: ---- getmail-4.42.0.tar.gz New: ---- getmail-4.43.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ getmail.spec ++++++ --- /var/tmp/diff_new_pack.OCQqL4/_old 2013-10-01 08:12:18.000000000 +0200 +++ /var/tmp/diff_new_pack.OCQqL4/_new 2013-10-01 08:12:18.000000000 +0200 @@ -17,7 +17,7 @@ Name: getmail -Version: 4.42.0 +Version: 4.43.0 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Url: http://pyropus.ca/software/getmail/ @@ -61,7 +61,7 @@ %prep %setup -q -%patch1 +%patch1 -p1 %__sed -i \ -e 's|@@DOCDIR@@|%{_docdir}/%{name}|g' \ -e 's|@@MANDIR@@|%{_mandir}|g' \ ++++++ getmail-4.42.0.tar.gz -> getmail-4.43.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.42.0/PKG-INFO new/getmail-4.43.0/PKG-INFO --- old/getmail-4.42.0/PKG-INFO 2013-08-03 22:27:35.000000000 +0200 +++ new/getmail-4.43.0/PKG-INFO 2013-08-26 05:00:08.000000000 +0200 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.0 Name: getmail -Version: 4.42.0 +Version: 4.43.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.42.0/docs/CHANGELOG new/getmail-4.43.0/docs/CHANGELOG --- old/getmail-4.42.0/docs/CHANGELOG 2013-08-03 22:27:22.000000000 +0200 +++ new/getmail-4.43.0/docs/CHANGELOG 2013-08-26 04:51:30.000000000 +0200 @@ -1,3 +1,7 @@ +Version 4.43.0 +25 August 2013 + -add IMAP IDLE support. Thanks: Jon Gjengset. + Version 4.42.0 3 August 2013 -fix problem with non-ascii characters in newly-added message header fields diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.42.0/docs/configuration.html new/getmail-4.43.0/docs/configuration.html --- old/getmail-4.42.0/docs/configuration.html 2013-08-03 22:27:26.000000000 +0200 +++ new/getmail-4.43.0/docs/configuration.html 2013-08-26 05:00:07.000000000 +0200 @@ -2730,6 +2730,13 @@ <li>--trace — print extended debugging information</li> </ul> <p> + If you are using a single getmailrc file with an IMAP server that understands + the IDLE extension from <a href="http://www.rfc-editor.org/rfc/rfc2177.txt">RFC 2177</a>, + you can use the --rcfile=<span class="meta">MAILBOX</span> option to specify + that getmail should wait on the server to notify getmail of new mail in the + specified mailbox after getmail is finished retrieving mail. +</p> +<p> In addition, the following commandline options can be used to override any values specified in the <span class="file">[options]</span> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.42.0/docs/getmail.1 new/getmail-4.43.0/docs/getmail.1 --- old/getmail-4.42.0/docs/getmail.1 2009-08-07 00:20:44.000000000 +0200 +++ new/getmail-4.43.0/docs/getmail.1 2013-08-26 04:17:26.000000000 +0200 @@ -33,6 +33,11 @@ .TP \fB\-\-trace\fR print extended trace information (extremely verbose) +.TP +\fB\-i\fIFOLDER\fR, \fB\-\-idle\fR=\fIFOLDER\fR +maintain connection and listen for new messages in \fR\fIFOLDER\fI\fR. +This flag will only work if a single rc file is given, and will only work on +IMAP connections where the server supports IMAP4 IDLE (RFC 2177). .PP The following options override any in the configuration file(s). .TP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.42.0/getmail new/getmail-4.43.0/getmail --- old/getmail-4.42.0/getmail 2013-04-21 19:09:57.000000000 +0200 +++ new/getmail-4.43.0/getmail 2013-08-26 04:49:38.000000000 +0200 @@ -106,7 +106,7 @@ 'GNU GPL version 2.\n') ####################################### -def go(configs): +def go(configs, idle): """Main code. Returns True if all goes well, False if any error condition occurs. @@ -114,7 +114,27 @@ blurb() summary = [] errorexit = False + idling = False + + if len(configs) > 1 and idle: + log.info('more than one config file given with --idle, ignoring\n') + idle = False + for (configfile, retriever, _filters, destination, options) in configs: + if options['read_all'] and not options['delete']: + if idle: + # This is a nonsense combination of options; every time the + # server returns from IDLE, all messages will be re-retrieved. + log.error('%s: IDLE, read_all, and not delete - bad ' + 'combination, skipping\n' + % retriever) + continue + else: + # Slightly less nonsensical, but still weird. + log.warning('%s: read_all and not delete -- all messages will ' + 'be retrieved each time getmail is run\n' + % retriever) + oplevel = options['verbose'] logverbose = options['message_log_verbose'] now = int(time.time()) @@ -124,14 +144,16 @@ if options['message_log_syslog']: syslog.openlog('getmail', 0, syslog.LOG_MAIL) try: - log.info('%s:\n' % retriever) - logline = 'Initializing %s:' % retriever - if options['logfile'] and logverbose: - options['logfile'].write(logline) - if options['message_log_syslog'] and logverbose: - syslog.syslog(syslog.LOG_INFO, logline) - retriever.initialize(options) - destination.retriever_info(retriever) + if not idling: + log.info('%s:\n' % retriever) + logline = 'Initializing %s:' % retriever + if options['logfile'] and logverbose: + options['logfile'].write(logline) + if options['message_log_syslog'] and logverbose: + syslog.syslog(syslog.LOG_INFO, logline) + retriever.initialize(options) + destination.retriever_info(retriever) + for mailbox in retriever.mailboxes: if mailbox: # For POP this is None and uninteresting @@ -370,6 +392,39 @@ ) log.debug('retriever %s finished\n' % retriever) try: + if idle and not retriever.supports_idle: + log.info('--idle given, but chosen retriever does not support' + 'IDLE\n') + idle = False + + if not errorexit and idle: + # TODO + # Okay, so what should really happen here is that when go_idle + # returns, getmail should use the *existing* connection to check + # for new messages and then call go_idle again once that is + # done. The current code layout doesn't lend itself very well to + # that since the message download code is coupled with the + # connection setup/teardown code. + # + # Therefore, we do a bit of a hack. + # We add the current config back into configs, so that when the + # main for loop over configs runs again, it will find the same + # config again, and thus download the new messages and then go + # back to IDLEing. Since the return value of go_idle changes the + # value of idling, a failed connection will cause it to become + # False, which will make the main go() loop reconnect, which is + # what we want. + try: + idling = retriever.go_idle(idle) + configs.append(configs[0]) + continue + except KeyboardInterrupt, o: + # Because configs isn't appended to, this just means we'll + # quit, which is presumably what the user wanted + # The newline is to clear the ^C shown in terminal + log.info('\n') + pass + retriever.quit() except getmailOperationError, o: errorexit = True @@ -413,6 +468,14 @@ dest='trace', action='store_true', default=False, help='print extended trace information (extremely verbose)' ) + parser.add_option( + '-i', '--idle', + dest='idle', action='store', default='', + help='maintain connection and listen for new messages in FOLDER. ' + 'Only applies if a single rc file is given with a connection ' + 'to an IMAP server that supports the IDLE command', + metavar='FOLDER' + ) if gnomekeyring: parser.add_option( '--store-password-in-gnome-keyring', @@ -786,7 +849,7 @@ sys.exit() # Go! - success = go(configs) + success = go(configs, options.idle) if not success: raise SystemExit(127) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.42.0/getmail.spec new/getmail-4.43.0/getmail.spec --- old/getmail-4.42.0/getmail.spec 2013-08-03 22:27:26.000000000 +0200 +++ new/getmail-4.43.0/getmail.spec 2013-08-26 05:00:08.000000000 +0200 @@ -2,7 +2,7 @@ Summary: POP3 mail retriever with reliable Maildir delivery Name: getmail -Version: 4.42.0 +Version: 4.43.0 Release: 1 License: GPL Group: Applications/Internet @@ -52,6 +52,12 @@ %{python_sitelib}/getmailcore/ %changelog +* Sun Aug 25 2013 Charles Cazabon <[email protected]> +-update to version 4.43.0 + +* Sun Aug 25 2013 Charles Cazabon <[email protected]> +-update to version 4.43.0 + * Sat Aug 03 2013 Charles Cazabon <[email protected]> -update to version 4.42.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.42.0/getmailcore/__init__.py new/getmail-4.43.0/getmailcore/__init__.py --- old/getmail-4.42.0/getmailcore/__init__.py 2013-08-03 22:27:04.000000000 +0200 +++ new/getmail-4.43.0/getmailcore/__init__.py 2013-08-26 04:50:44.000000000 +0200 @@ -16,7 +16,7 @@ raise ImportError('getmail version 4 requires Python version 2.3.3' ' or later') -__version__ = '4.42.0' +__version__ = '4.43.0' __all__ = [ 'baseclasses', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/getmail-4.42.0/getmailcore/_retrieverbases.py new/getmail-4.43.0/getmailcore/_retrieverbases.py --- old/getmail-4.42.0/getmailcore/_retrieverbases.py 2013-05-26 18:25:05.000000000 +0200 +++ new/getmail-4.43.0/getmailcore/_retrieverbases.py 2013-08-26 04:31:45.000000000 +0200 @@ -42,6 +42,7 @@ import poplib import imaplib import re +import select try: # do we have a recent pykerberos? @@ -119,6 +120,7 @@ class POP3initMixIn(object): '''Mix-In class to do POP3 non-SSL initialization. ''' + SSL = False def _connect(self): self.log.trace() try: @@ -144,6 +146,7 @@ '''Mix-In class to do POP3 over SSL initialization with Python 2.4's poplib.POP3_SSL class. ''' + SSL = True def _connect(self): self.log.trace() if not hasattr(socket, 'ssl'): @@ -191,6 +194,7 @@ '''Mix-In class to do POP3 over SSL initialization with custom-implemented code to support SSL with Python 2.3's poplib.POP3 class. ''' + SSL = True def _connect(self): self.log.trace() if not hasattr(socket, 'ssl'): @@ -237,6 +241,7 @@ class IMAPinitMixIn(object): '''Mix-In class to do IMAP non-SSL initialization. ''' + SSL = False def _connect(self): self.log.trace() try: @@ -259,6 +264,7 @@ class IMAPSSLinitMixIn(object): '''Mix-In class to do IMAP over SSL initialization. ''' + SSL = True def _connect(self): self.log.trace() if not hasattr(socket, 'ssl'): @@ -372,7 +378,6 @@ initialize(self, options) checkconf(self) ''' - def __init__(self, **args): self.headercache = {} self.deleted = {} @@ -382,6 +387,7 @@ self.gotmsglist = False self._clear_state() self.conn = None + self.supports_idle = False ConfigurableBase.__init__(self, **args) def _clear_state(self): @@ -1275,7 +1281,11 @@ + os.linesep) del self.oldmail[msgid] """ - + + if 'IDLE' in self.conn.capabilities: + self.supports_idle = True + imaplib.Commands['IDLE'] = ('AUTH', 'SELECTED') + if self.mailboxes == ('ALL', ): # Special value meaning all mailboxes in account self.mailboxes = tuple(self.list_mailboxes()) @@ -1294,6 +1304,72 @@ pass self.conn = None + def go_idle(self, folder, timeout=29*60): + """Initiates IMAP's IDLE mode if the server supports it + + Waits until state of current mailbox changes, and then returns. Returns + True if the connection still seems to be up, False otherwise. + + May throw getmailOperationError if the server refuses the IDLE setup + (e.g. if the server does not support IDLE) + + Default timeout is the maximum possible idle time according to RFC 2177. + """ + + if not self.supports_idle: + self.log.warning('IDLE not supported, so not idling') + raise getmailOperationError( + 'IMAP4 IDLE requested, but not supported by server' + ) + + + if self.SSL: + sock = self.conn.ssl() + else: + sock = self.conn.socket() + + # Based on current imaplib IDLE patch: http://bugs.python.org/issue11245 + self.conn.untagged_responses = {} + self.conn.select(folder) + tag = self.conn._command('IDLE') + data = self.conn._get_response() # read continuation response + + if data is not None: + raise getmailOperationError( + 'IMAP4 IDLE requested, but server refused IDLE request: %s' + % data + ) + + self.log.debug('Entering IDLE mode (server says "%s")\n' + % self.conn.continuation_response) + + try: + aborted = None + (readable, unused, unused) = select.select([sock], [], [], timeout) + except KeyboardInterrupt, o: + # Delay raising this until we've stopped IDLE mode + aborted = o + + if aborted is not None: + self.log.debug('IDLE mode cancelled\n') + elif readable: + # The socket has data waiting; server has updated status + self.log.info('IDLE message received\n') + else: + self.log.debug('IDLE timeout (%ds)\n' % timeout) + + try: + self.conn.untagged_responses = {} + self.conn.send('DONE\r\n') + self.conn._command_complete('IDLE', tag) + except imaplib.IMAP4.error, o: + return False + + if aborted: + raise aborted + + return True + def quit(self): self.log.trace() if not self.conn: ++++++ getmail-fix_paths.patch ++++++ --- /var/tmp/diff_new_pack.OCQqL4/_old 2013-10-01 08:12:18.000000000 +0200 +++ /var/tmp/diff_new_pack.OCQqL4/_new 2013-10-01 08:12:18.000000000 +0200 @@ -1,6 +1,8 @@ ---- setup.py.orig 2009-10-08 10:16:54.000000000 +0200 -+++ setup.py 2009-10-08 11:56:58.000000000 +0200 -@@ -35,19 +35,8 @@ +Index: getmail-4.43.0/setup.py +=================================================================== +--- getmail-4.43.0.orig/setup.py ++++ getmail-4.43.0/setup.py +@@ -35,19 +35,8 @@ for (pos, arg) in enumerate(args): # hack hack hack hack hack hack hack datadir = args[pos + 1] @@ -22,7 +24,7 @@ if '--show-default-install-dirs' in args: print 'Default installation directories:' -@@ -100,7 +89,6 @@ +@@ -100,7 +89,6 @@ setup( data_files=[ (GETMAILDOCDIR, [ './README', -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
