[offlineimap] Error while syncing mailbox using cyrillic (#196)

andreygursky notifications at github.com
Sat May 9 19:21:59 BST 2015


Despite of workaround mentioned in https://github.com/OfflineIMAP/offlineimap/issues/192, there is an issue with cyrillic. The first run of offlineimap successfully downloaded many messages, until it had to reestablish a connection to the gmail server:
```
< --- cut --- >
Folder INBOX [acc: mygmail]:
 Copy message 2601 (2601 of 34263) Remote:INBOX -> Local
Folder [Gmail]/Уся пошта [remote name [Gmail]/&BCMEQQRP- &BD8EPgRIBEIEMA-] [acc: mygmail]:
 Copy message 16316 (15924 of 34463) Remote:[Gmail]/&BCMEQQRP- &BD8EPgRIBEIEMA- -> Local
Folder INBOX [acc: mygmail]:
 Copy message 2602 (2602 of 34263) Remote:INBOX -> Local
Copy message from Remote:INBOX:
 Establishing connection to imap.gmail.com:993
Folder [Gmail]/Уся пошта [remote name [Gmail]/&BCMEQQRP- &BD8EPgRIBEIEMA-] [acc: mygmail]:
 Copy message 16317 (15925 of 34463) Remote:[Gmail]/&BCMEQQRP- &BD8EPgRIBEIEMA- -> Local
Thread 'Copy message from Remote:[Gmail]/&BCMEQQRP- &BD8EPgRIBEIEMA-' terminated with exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/offlineimap/threadutil.py", line 163, in run
    Thread.run(self)
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/dist-packages/offlineimap/folder/Gmail.py", line 291, in copymessageto
    super(GmailFolder, self).copymessageto(uid, dstfolder, statusfolder, register)
  File "/usr/lib/python2.7/dist-packages/offlineimap/folder/Base.py", line 770, in copymessageto
    message = self.getmessage(uid)
  File "/usr/lib/python2.7/dist-packages/offlineimap/folder/Gmail.py", line 77, in getmessage
    data = self._fetch_from_imap(imapobj, str(uid), 2)
  File "/usr/lib/python2.7/dist-packages/offlineimap/folder/IMAP.py", line 684, in _fetch_from_imap
    imapobj.select(self.getfullname(), readonly = True)
  File "/usr/lib/python2.7/dist-packages/offlineimap/imaplibutil.py", line 50, in select
    result = super(UsefulIMAPMixIn, self).select(mailbox, readonly)
  File "/usr/lib/python2.7/dist-packages/offlineimap/imaplib2.py", line 1008, in select
    typ, dat = rqb.get_response('command: %s => %%s' % rqb.name)
  File "/usr/lib/python2.7/dist-packages/offlineimap/imaplib2.py", line 188, in get_response
    raise typ(exc_fmt % str(val))
OfflineImapError: Server 'imap.gmail.com' closed connection, error on SELECT '[Gmail]/&BCMEQQRP- &BD8EPgRIBEIEMA-'. Server said: command: EXAMINE => socket error: <class 'socket.error'> - [Errno 104] Connection reset by peer


Last 1 debug messages logged for Copy message from Remote:[Gmail]/&BCMEQQRP- &BD8EPgRIBEIEMA- prior to exception:
thread: Register new thread 'Copy message from Remote:[Gmail]/&BCMEQQRP- &BD8EPgRIBEIEMA-' (account 'mygmail')
Exception in thread Copy message from Remote:INBOX (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
  File "/usr/lib/python2.7/dist-packages/offlineimap/threadutil.py", line 239, in run
  File "/usr/lib/python2.7/dist-packages/offlineimap/threadutil.py", line 163, in run
  File "/usr/lib/python2.7/threading.py", line 763, in run
  File "/usr/lib/python2.7/dist-packages/offlineimap/folder/Gmail.py", line 291, in copymessageto
  File "/usr/lib/python2.7/dist-packages/offlineimap/folder/Base.py", line 770, in copymessageto
  File "/usr/lib/python2.7/dist-packages/offlineimap/folder/Gmail.py", line 75, in getmessage
  File "/usr/lib/python2.7/dist-packages/offlineimap/imapserver.py", line 439, in acquireconnection
  File "/usr/lib/python2.7/dist-packages/offlineimap/imaplibutil.py", line 186, in __init__
  File "/usr/lib/python2.7/dist-packages/offlineimap/imaplib2.py", line 2063, in __init__
  File "/usr/lib/python2.7/dist-packages/offlineimap/imaplib2.py", line 344, in __init__
  File "/usr/lib/python2.7/dist-packages/offlineimap/imaplibutil.py", line 194, in open
  File "/usr/lib/python2.7/dist-packages/offlineimap/imaplib2.py", line 2076, in open
  File "/usr/lib/python2.7/dist-packages/offlineimap/imaplib2.py", line 470, in ssl_wrap_socket
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'SOL_SOCKET'
$
```

Now I'm getting always this traceback:
```
OfflineIMAP 6.5.7-rc4
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
Account sync mygmail:
 *** Processing account mygmail
 Establishing connection to imap.gmail.com:993
 ERROR: While attempting to sync account 'mygmail'
  'ascii' codec can't decode byte 0xd0 in position 8: ordinal not in range(128)
 *** Finished account 'mygmail' in 0:06
ERROR: Exceptions occurred during the run!
ERROR: While attempting to sync account 'mygmail'
  'ascii' codec can't decode byte 0xd0 in position 8: ordinal not in range(128)

Traceback:
  File "/usr/lib/python2.7/dist-packages/offlineimap/accounts.py", line 263, in syncrunner
    self.__sync()
  File "/usr/lib/python2.7/dist-packages/offlineimap/accounts.py", line 329, in __sync
    remoterepos.sync_folder_structure(localrepos, statusrepos)
  File "/usr/lib/python2.7/dist-packages/offlineimap/repository/Base.py", line 224, in sync_folder_structure
    folder = self.getfolder(dst_name_t)
  File "/usr/lib/python2.7/dist-packages/offlineimap/repository/Gmail.py", line 63, in getfolder
    self)
  File "/usr/lib/python2.7/dist-packages/offlineimap/folder/Gmail.py", line 46, in __init__
    super(GmailFolder, self).__init__(imapserver, name, repository)
  File "/usr/lib/python2.7/dist-packages/offlineimap/folder/IMAP.py", line 48, in __init__
    super(IMAPFolder, self).__init__(name, repository)
  File "/usr/lib/python2.7/dist-packages/offlineimap/folder/Base.py", line 44, in __init__
    self.visiblename = repository.nametrans(name)
  File "<string>", line 1, in <lambda>
$
```

With -d ALL:
```
< --- cut --- >
imap.gmail.com handler:
 [imap]:   17:15.85 imap.gmail.com handler LIST:MOPI7.ready.set
Account sync mygmail:
 [maildir]: _GETFOLDERS_SCANDIR STARTING. root =              < --- cut --- >

 [maildir]:   dirname = [Gmail].Чернетки
 [maildir]:   This is maildir folder '[Gmail].Чернетки'.
 [maildir]:   dirname = 
 [maildir]: _GETFOLDERS_SCANDIR RETURNING ['Drafts', '[Gmail].\xd0\x9d\xd0\xb0\xd0\xb4\xd1\x96\xd1\x81\xd0\xbb\xd0\xb0\xd0\xbd\xd1\x96', 'mozilla', 'Sent', 'debian-embedded', '[Gmail].\xd0\x9a\xd0\xbe\xd1\x88\xd0\xb8\xd0\xba', 'INBOX', 'angstrom-users', '\xd0\x9e\xd1\x87\xd1\x96\xd0\xba\xd1\x83\xd1\x8e\xd1\x82\xd1\x8c \xd0\xb2\xd1\x96\xd0\xb4\xd0\xbf\xd0\xbe\xd0\xb2\xd1\x96\xd0\xb4\xd1\x96', '\xd0\x86\xd0\xbd\xd1\x88\xd1\x96', 'Queue', '[Gmail].\xd0\xa1\xd0\xbf\xd0\xb0\xd0\xbc', '\xd0\x9f\xd1\x80\xd1\x96\xd0\xbe\xd1\x80\xd0\xb8\xd1\x82\xd0\xb5\xd1\x82\xd0\xbd\xd1\x96', '[Gmail].\xd0\x86\xd0\xb7 \xd0\xb7\xd1\x96\xd1\x80\xd0\xbe\xd1\x87\xd0\xba\xd0\xbe\xd1\x8e', 'coreboot', '[Gmail].\xd0\x92\xd0\xb0\xd0\xb6\xd0\xbb\xd0\xb8\xd0\xb2\xd0\xbe', 'Trash', '[Gmail].\xd0\xa3\xd1\x81\xd1\x8f \xd0\xbf\xd0\xbe\xd1\x88\xd1\x82\xd0\xb0', '[Gmail].\xd0\xa7\xd0\xb5\xd1\x80\xd0\xbd\xd0\xb5\xd1\x82\xd0\xba\xd0\xb8']
 [imap]:   17:15.95 Account sync mygmail state => LOGOUT
 [imap]:   17:15.96 Account sync mygmail [sync] LOGOUT ()
 [imap]:   17:15.96 Account sync mygmail state_change_pending.acquire
 [imap]:   17:15.96 Account sync mygmail _request_push(MOPI8, LOGOUT, {}) = MOPI8
 [imap]:   17:15.96 Account sync mygmail data=MOPI8 LOGOUT
< --- cut --- >
```

---
Reply to this email directly or view it on GitHub:
https://github.com/OfflineIMAP/offlineimap/issues/196
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20150509/a0be1c3e/attachment-0002.html>


More information about the OfflineIMAP-project mailing list