Package: getmail4
Version: 4.20.0-1
Severity: normal
Tags: upstream patch

When I try to retrieve mail via POP3 from Yahoo, getmail4 sometimes
exits with a KeyError.

The problem occurs in _retrieverbases.py, class POP3RetrieverBase,
function _getmsglist(), when 
    response, msglist, octets = self.conn.uidl()
returns an empty msglist, but afterwards
    response, msglist, octets = self.conn.list()
returns a non-empty msglist.

Solution: Move some code below a new "if msglist:".
Patch:

--- getmail-4.22.1/getmailcore/_retrieverbases.py.orig  2011-10-01 
06:21:51.000000000 +0200
+++ getmail-4.22.1/getmailcore/_retrieverbases.py       2011-11-09 
20:53:52.000000000 +0100
@@ -605,12 +605,13 @@ class POP3RetrieverBase(RetrieverSkeleto
                     self.msgid_by_msgnum[msgnum] = msgid
             self.log.debug('Message IDs: %s'
                            % sorted(self.msgnum_by_msgid.keys()) + os.linesep)
-            self.sorted_msgnum_msgid = sorted(self.msgid_by_msgnum.items())
-            response, msglist, octets = self.conn.list()
-            for line in msglist:
-                msgnum = int(line.split()[0])
-                msgsize = int(line.split()[1])
-                self.msgsizes[self.msgid_by_msgnum[msgnum]] = msgsize
+            if msglist:
+                self.sorted_msgnum_msgid = sorted(self.msgid_by_msgnum.items())
+                response, msglist, octets = self.conn.list()
+                for line in msglist:
+                    msgnum = int(line.split()[0])
+                    msgsize = int(line.split()[1])
+                    self.msgsizes[self.msgid_by_msgnum[msgnum]] = msgsize
         except poplib.error_proto, o:
             raise getmailOperationError(
                 'POP error (%s) - if your server does not support the UIDL '


Details:

$ getmail -rACCOUNT
getmail version 4.20.0
Copyright (C) 1998-2009 Charles Cazabon.  Licensed under the GNU GPL version 2.
SimplePOP3Retriever:r.koeb...@pop.mail.yahoo.de:110:

Exception: please read docs/BUGS and include the following information in any 
bug report:

  getmail version 4.20.0
  Python version 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) 
[GCC 4.4.5]

Unhandled exception follows:
    File "/usr/bin/getmail", line 685, in main
    go(configs)
    File "/usr/bin/getmail", line 102, in go
    retriever.initialize()
    File "/usr/share/getmail4/getmailcore/_retrieverbases.py", line 571, in 
initialize
    self._getmsglist()
    File "/usr/share/getmail4/getmailcore/_retrieverbases.py", line 519, in 
_getmsglist
    self.msgsizes[self.msgid_by_msgnum[msgnum]] = msgsize
  KeyError: 1

Please also include configuration information from running getmail
with your normal options plus "--dump".


$ getmail -rACCOUNT --dump
getmail version 4.20.0
Copyright (C) 1998-2009 Charles Cazabon.  Licensed under the GNU GPL version 2.
getmail configuration:
  getmail version 4.20.0
  Python version 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) 
[GCC 4.4.5]
  retriever:  SimplePOP3Retriever(delete_dup_msgids="False", getmaildir="...", 
password="*", port="110", server="pop.mail.yahoo.de", timeout="180", 
use_apop="False", username="...")
  destination:  ...
  options:
    delete : True
    delete_after : 0
    delivered_to : False
    logfile : logfile(filename="...")
    max_bytes_per_session : 0
    max_message_size : 0
    max_messages_per_session : 0
    message_log : ...
    message_log_syslog : False
    message_log_verbose : False
    read_all : True
    received : False
    verbose : 1



-- System Information:
Debian Release: 6.0.3
  APT prefers stable
  APT policy: (500, 'stable'), (160, 'testing'), (150, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages getmail4 depends on:
ii  python                  2.6.6-3+squeeze6 interactive high-level object-orie
ii  python-support          1.0.10           automated rebuilding support for P

getmail4 recommends no packages.

getmail4 suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to