Your message dated Mon, 3 Mar 2008 01:16:10 -0600
with message-id <[EMAIL PROTECTED]>
and subject line Closing
has caused the Debian Bug report #297184,
regarding offlineimap: crash if IMAPD rejects NUL characters
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)
--
297184: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=297184
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: offlineimap
Version: 4.0.9
Severity: important
Tags: patch
Cryrus IMAPD rejects mails with a NUL characters in them,
and offlineimap 4.0.9 crashes in the error from IMAP:
EEKF9 NO Message contains NUL characters
... place of the crash:
offlineimap/folder/IMAP.py:savemessage():
assert(imapobj.append(self.getfullname(),
imaputil.flagsmaildir2imap(flags),
date, content)[0] == 'OK')
Longer description and fix:
As it so happens, my mail server, which puts mail into my
maildir folder happily passes mail with NULL characters
but Cyrus IMAP, where I want to sync the mail to, does
not. Because this could happen anytime again because
of spam for example, I need to fix the crash in offlineimap
instead of working around it - I need to have it working
for unattended operation and my email is critical.
Therefore I looked at a place to fix the crash and did my
change here:
offlineimap/folder/IMAP.py:
ui.debug('imap', 'savemessage: using date ' + str(date))
- content = re.sub("(?<!\r)\n", "\r\n", content)
+ content = re.sub("(?<!\r)\n", "\r\n", content.replace("\0", "=00"))
ui.debug('imap', 'savemessage: initial content is: ' + repr(content))
works fine - you can choose to replace \0 with also with nothing,
I choose =00 because it's the quoted-printable sequence for \0,
so this does not fix something but clearly shows me that this
message had a replaced \0 character, that's all.
-- System Information:
Debian Release: 3.1
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.27
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Versions of packages offlineimap depends on:
ii python2.3 2.3.5-1 An interactive high-level object-o
-- no debconf information
PS: Thanks for offlineimap, works great now!
--- offlineimap/folder/IMAP.py
+++ offlineimap/folder/IMAP.py
@@ -207,7 +207,7 @@
date = imaplib.Time2Internaldate(time.localtime())
ui.debug('imap', 'savemessage: using date ' + str(date))
- content = re.sub("(?<!\r)\n", "\r\n", content)
+ content = re.sub("(?<!\r)\n", "\r\n", content.replace("\0", "=00"))
ui.debug('imap', 'savemessage: initial content is: ' +
repr(content))
(headername, headervalue) = self.savemessage_getnewheader(content)
--- End Message ---
--- Begin Message ---
Closing due to no response from the submitter since 2005
--
John Goerzen
Author, Foundations of Python Network Programming
http://www.amazon.com/exec/obidos/tg/detail/-/1590593715
--- End Message ---