/head: changeset 21
More bugfixes
This commit is contained in:
parent
9eff85dd0c
commit
fd4ad59286
@ -21,7 +21,6 @@ from imapsync import imaplib, imaputil, imapserver, repository, folder
|
|||||||
import re, getpass, os, os.path
|
import re, getpass, os, os.path
|
||||||
from ConfigParser import ConfigParser
|
from ConfigParser import ConfigParser
|
||||||
|
|
||||||
imaplib.Debug = 5
|
|
||||||
config = ConfigParser()
|
config = ConfigParser()
|
||||||
config.read("imapsync.conf")
|
config.read("imapsync.conf")
|
||||||
metadatadir = os.path.expanduser(config.get("general", "metadata"))
|
metadatadir = os.path.expanduser(config.get("general", "metadata"))
|
||||||
@ -67,11 +66,12 @@ for accountname in accounts:
|
|||||||
#if not localfolder.isuidvalidityok(remotefolder):
|
#if not localfolder.isuidvalidityok(remotefolder):
|
||||||
# print 'UID validity is a problem for this folder; skipping.'
|
# print 'UID validity is a problem for this folder; skipping.'
|
||||||
# continue
|
# continue
|
||||||
#print "Reading remote message list...",
|
print "Reading remote message list...",
|
||||||
#remotefolder.cachemessagelist()
|
remotefolder.cachemessagelist()
|
||||||
#print len(remotefolder.getmessagelist().keys()), "messages."
|
print len(remotefolder.getmessagelist().keys()), "messages."
|
||||||
print "Reading local message list...",
|
print "Reading local message list...",
|
||||||
localfolder.cachemessagelist()
|
localfolder.cachemessagelist()
|
||||||
print len(localfolder.getmessagelist().keys()), "messages."
|
print len(localfolder.getmessagelist().keys()), "messages."
|
||||||
print "Synchronizing locally-made changes..."
|
print "Synchronizing remote to local..."
|
||||||
|
remotefolder.syncmessagesto(localfolder)
|
||||||
|
|
||||||
|
@ -39,6 +39,9 @@ class IMAPFolder(BaseFolder):
|
|||||||
response = self.imapobj.status(self.getfullname(), ('MESSAGES'))[1][0]
|
response = self.imapobj.status(self.getfullname(), ('MESSAGES'))[1][0]
|
||||||
result = imaputil.imapsplit(response)[1]
|
result = imaputil.imapsplit(response)[1]
|
||||||
maxmsgid = long(imaputil.flags2hash(result)['MESSAGES'])
|
maxmsgid = long(imaputil.flags2hash(result)['MESSAGES'])
|
||||||
|
if (maxmsgid < 1):
|
||||||
|
# No messages? return.
|
||||||
|
return
|
||||||
|
|
||||||
# Now, get the flags and UIDs for these.
|
# Now, get the flags and UIDs for these.
|
||||||
response = self.imapobj.fetch('1:%d' % maxmsgid, '(FLAGS UID)')[1]
|
response = self.imapobj.fetch('1:%d' % maxmsgid, '(FLAGS UID)')[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user