Complete.Org: Mailing Lists: Archives: offlineimap: March 2006:
Re: offlineimap, mutt and exchange.
Home

Re: offlineimap, mutt and exchange.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Steve Traylen <s.traylen@xxxxxxxx>
Cc: offlineimap@xxxxxxxxxxxx
Subject: Re: offlineimap, mutt and exchange.
From: Andrew Biggadike <biggadike@xxxxxxxxxxxxxx>
Date: Fri, 17 Mar 2006 08:48:07 -0800

Steve Traylen <s.traylen@xxxxxxxx> wrote:
> In the last few days I'm using offlineimap to sync an imap enabled=20
> M$ exchange server to a local maildir that I then read with mutt.
> 
> Everything almost works perfectly except for one annoyance.
> 
> Often in Mutt messages that I have read appear in the index=20
> with the 'O' flag which is for old.
> 
>   20 r   Mar 17 Steve Traylen   (0.7K) Headphones and cameras.
>   21     Mar 17 Steve Traylen   (1.1K) =E2=94=94=E2=94=80>
>   22     Mar 17 Bruffell, J (Ja (1.6K) Angie Loveday is leaving RAL
>   23 O   Mar 17 Wheeler, JF (Jo (1.6K) [Gridpp #13015] Re: PBS JOB 228215=
> 6.csfln  24 O   Mar 17 Sansum, RA (And (0.2K) Leave this PM
> 
> Despite the fact that these messages have been read in Mutt they=20
> appear on the exchange server via outlook still as new and
> unread.

I posted about a similar problem last week.  I investigated enough to
find that -- for some reason -- offlineimap is creating Maildir files
with invalid flags.  The diff below fixed my problem and I haven't
yet had time to figure out why savemessageflags() is getting called
with invalid flags such as '(', '\\', 'e'. 

Have a look in your Maildir directory and see if you have filenames
ending with something like ":)S()S()Se()S\e2,()S\en".  If so, this
diff may remove the annoyance until we find the actual cause of this.
For what it's worth, I am also syncing an Exchange IMAP to Maildir and
using mutt as my MUA.
 
> Reading the messages again in Mutt is enough to switch the messages
> to read on the imap server.

Does this also remove the 'O' flag within mutt?  Does reading once
always take care of it?  There were occurrences where I opened a
message in mutt such that its 'O' flag was removed and, then, on the
next offlineimap sync, those extra invalid flags were added back and I
had to go the process again (perhaps even a few times).
 
> I guess the imap server is not respecting some flag that mutt is
> setting. Any ideas?

Without looking at any mutt source or observing Exchange behavior, I
would guess it's either the opposite -- Exchange setting flags that
mutt doesn't handle -- or a bug in offlineimap.  The list of realflags
in the diff are all those listed in djb's description of what goes in
the info part of Maildir filenames.


--- offlineimap/folder/Maildir.py       2005-04-16 08:02:08.000000000 -0700
+++ Maildir.py  2006-03-17 08:18:01.727958264 -0800
@@ -181,6 +181,8 @@

     def savemessageflags(self, uid, flags):
         oldfilename = self.messagelist[uid]['filename']
+        realflags = ['P', 'R', 'S', 'T', 'D', 'F']
+        flags = [flag for flag in flags if flag in realflags]
         newpath, newname = os.path.split(oldfilename)
         if 'S' in flags:
             # If a message has been seen, it goes into the cur



[Prev in Thread] Current Thread [Next in Thread]