Merge branch 'vm/windows-maildir' into next
Conflicts: docs/MANUAL.rst
This commit is contained in:
commit
7fe5e14611
@ -300,6 +300,27 @@ KNOWN BUGS
|
|||||||
* IDLE may only work "once" per refresh. If you encounter this bug,
|
* IDLE may only work "once" per refresh. If you encounter this bug,
|
||||||
please send a report to the list!
|
please send a report to the list!
|
||||||
|
|
||||||
|
* Maildir support in Windows drive
|
||||||
|
Maildir uses colon caracter (:) in message file names. Colon is however
|
||||||
|
forbidden character in windows drives. There are several workarounds for
|
||||||
|
that situation:
|
||||||
|
|
||||||
|
* Use "maildir-windows-compatible = yes" account OfflineIMAP configuration.
|
||||||
|
- That makes OfflineIMAP to use exclamation mark (!) instead of colon for
|
||||||
|
storing messages. Such files can be written to windows partitions. But
|
||||||
|
you will probably loose compatibility with other programs trying to
|
||||||
|
read the same Maildir.
|
||||||
|
- Exclamation mark was choosed because of the note in
|
||||||
|
http://docs.python.org/library/mailbox.html
|
||||||
|
- If you have some messages already stored without this option, you will
|
||||||
|
have to re-sync them again
|
||||||
|
|
||||||
|
* Enable file name character translation in windows registry (not tested)
|
||||||
|
- http://support.microsoft.com/kb/289627
|
||||||
|
|
||||||
|
* Use cygwin managed mount (not tested)
|
||||||
|
- not available anymore since cygwin 1.7
|
||||||
|
|
||||||
|
|
||||||
Synchronization Performance
|
Synchronization Performance
|
||||||
===========================
|
===========================
|
||||||
@ -389,3 +410,4 @@ contents. However, this will not protect you from active attacks, such
|
|||||||
as Man-In-The-Middle attacks which cause you to connect to the wrong
|
as Man-In-The-Middle attacks which cause you to connect to the wrong
|
||||||
server and pretend to be your mail server. DO NOT RELY ON STARTTLS AS A
|
server and pretend to be your mail server. DO NOT RELY ON STARTTLS AS A
|
||||||
SAFE CONNECTION GUARANTEEING THE AUTHENTICITY OF YOUR IMAP SERVER!
|
SAFE CONNECTION GUARANTEEING THE AUTHENTICITY OF YOUR IMAP SERVER!
|
||||||
|
=======
|
||||||
|
@ -239,6 +239,16 @@ remoterepository = RemoteExample
|
|||||||
|
|
||||||
# maxage = 3
|
# maxage = 3
|
||||||
|
|
||||||
|
|
||||||
|
# Maildir format uses colon (:) separator between uniq name and info.
|
||||||
|
# Unfortunatelly colon is not allowed character in windows file name. If you
|
||||||
|
# enable maildir-windows-compatible option, offlineimap will be able to store
|
||||||
|
# messages on windows drive, but you will probably loose compatibility with
|
||||||
|
# other programs working with the maildir
|
||||||
|
|
||||||
|
# maildir-windows-compatible = no
|
||||||
|
|
||||||
|
|
||||||
[Repository LocalExample]
|
[Repository LocalExample]
|
||||||
|
|
||||||
# This is one of the two repositories that you'll work with given the
|
# This is one of the two repositories that you'll work with given the
|
||||||
|
@ -31,7 +31,6 @@ except ImportError:
|
|||||||
from offlineimap import OfflineImapError
|
from offlineimap import OfflineImapError
|
||||||
|
|
||||||
uidmatchre = re.compile(',U=(\d+)')
|
uidmatchre = re.compile(',U=(\d+)')
|
||||||
flagmatchre = re.compile(':.*2,([A-Z]+)')
|
|
||||||
timestampmatchre = re.compile('(\d+)');
|
timestampmatchre = re.compile('(\d+)');
|
||||||
|
|
||||||
timeseq = 0
|
timeseq = 0
|
||||||
@ -63,6 +62,17 @@ class MaildirFolder(BaseFolder):
|
|||||||
self.messagelist = None
|
self.messagelist = None
|
||||||
self.repository = repository
|
self.repository = repository
|
||||||
self.accountname = accountname
|
self.accountname = accountname
|
||||||
|
|
||||||
|
self.wincompatible = self.config.getdefaultboolean(
|
||||||
|
"Account "+self.accountname, "maildir-windows-compatible", False)
|
||||||
|
|
||||||
|
if self.wincompatible == False:
|
||||||
|
self.infosep = ':'
|
||||||
|
else:
|
||||||
|
self.infosep = '!'
|
||||||
|
|
||||||
|
self.flagmatchre = re.compile(self.infosep + '.*2,([A-Z]+)')
|
||||||
|
|
||||||
BaseFolder.__init__(self)
|
BaseFolder.__init__(self)
|
||||||
#self.ui is set in BaseFolder.init()
|
#self.ui is set in BaseFolder.init()
|
||||||
# Cache the full folder path, as we use getfullname() very often
|
# Cache the full folder path, as we use getfullname() very often
|
||||||
@ -156,7 +166,7 @@ class MaildirFolder(BaseFolder):
|
|||||||
nouidcounter -= 1
|
nouidcounter -= 1
|
||||||
else:
|
else:
|
||||||
uid = long(uidmatch.group(1))
|
uid = long(uidmatch.group(1))
|
||||||
flagmatch = flagmatchre.search(messagename)
|
flagmatch = self.flagmatchre.search(messagename)
|
||||||
flags = []
|
flags = []
|
||||||
if flagmatch:
|
if flagmatch:
|
||||||
flags = [x for x in flagmatch.group(1)]
|
flags = [x for x in flagmatch.group(1)]
|
||||||
@ -271,11 +281,12 @@ class MaildirFolder(BaseFolder):
|
|||||||
dir_prefix = 'cur'
|
dir_prefix = 'cur'
|
||||||
else:
|
else:
|
||||||
dir_prefix = 'new'
|
dir_prefix = 'new'
|
||||||
infostr = ':'
|
|
||||||
infomatch = re.search('(:.*)$', newname)
|
infostr = self.infosep
|
||||||
|
infomatch = re.search('(' + self.infosep + '.*)$', newname)
|
||||||
if infomatch: # If the info string is present..
|
if infomatch: # If the info string is present..
|
||||||
infostr = infomatch.group(1)
|
infostr = infomatch.group(1)
|
||||||
newname = newname.split(':')[0] # Strip off the info string.
|
newname = newname.split(self.infosep)[0] # Strip off the info string.
|
||||||
infostr = re.sub('2,[A-Z]*', '', infostr)
|
infostr = re.sub('2,[A-Z]*', '', infostr)
|
||||||
flags.sort()
|
flags.sort()
|
||||||
infostr += '2,' + ''.join(flags)
|
infostr += '2,' + ''.join(flags)
|
||||||
|
Loading…
Reference in New Issue
Block a user