Complete.Org: Mailing Lists: Archives: offlineimap: October 2006:
Re: Bug: X-OfflineIMAP header in wrong place
Home

Re: Bug: X-OfflineIMAP header in wrong place

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Bruce Campbell <bru-offlineimap@xxxxxxxxxxxxxxxxxxxxxx>
Cc: offlineimap@xxxxxxxxxxxx
Subject: Re: Bug: X-OfflineIMAP header in wrong place
From: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Date: Wed, 18 Oct 2006 14:12:16 -0500

On Fri, Sep 08, 2006 at 10:46:27AM +1000, Bruce Campbell wrote:
> The problem is caused by the savemessage_addheader routine in IMAP.py, 
> unchanged since at least 4.0.8 .  This inserts the 'X-OfflineIMAP' header 
> after the first '\r\n' sequence.  In this case, this is in the middle of a 
> header and thus offlineimap has broken the header.  Eeek.  A quick trip 
> around the rosary of rfc 822 (3.1.1) may be in order.

Hrmm, over here my messages have a "From " line first, so this always
works.  I'm guessing that your messages don't have it.

Does it fix it for you if you simply change content.find("\r\n") to
content.find("\r\n\r\n"), so that the new header is always added at the
end of the headers?

> There are two solutions.  One is to search for a suitable place that is 
> not in the middle of a folded header.  The second is to treat the 
> 'X-OfflineIMAP' header as a trace header, and simply add it to the start 
> of the headers, not bothering to search for a spot.

Well, in that case, you'd have to skip From_ if it exists, but yeah...
or we can just always add at the end.

-- John



[Prev in Thread] Current Thread [Next in Thread]
  • Re: Bug: X-OfflineIMAP header in wrong place, John Goerzen <=