From 844ca6b08c0fd48035b58bfd8b88050c2688307b Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Fri, 2 May 2014 15:14:22 +0400 Subject: [PATCH] Don't embed CRLF multiple times when saving a message Since we just do multiple passes for saving the message without actually modifying its content (apart from header insertion that is CRLF-clean), we can change line ends to the proper CRLF just once. And we can also get message's date only once too. Signed-off-by: Eygene Ryabinkin --- offlineimap/folder/IMAP.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index d727b31..b7c0369 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -509,6 +509,12 @@ class IMAPFolder(BaseFolder): self.savemessageflags(uid, flags) return uid + # Use proper CRLF all over the message + content = re.sub("(?