I've made an initial pass at this which is _far_ from production ready but it does result in correct (or more correct than before) operation with SOGo. It also tests OK with python imaplib in basic tests.
I have a patch set which is not for merging (since it's nowhere near ready for that) - rather than just send to the list, I wanted to check what is the best was for someone to review it for any suggestions. I can gz and attach it if that's OK. I know I've got a number of things processed as EString when they should really be UString but I was aiming for basic functionality first. I suspect I'm also using some long-hand functions when there are already tuned efficient alternatives (pointing these out will be appreciated). Jim
