Code This

std::cout <<me.ramble() <<std::endl;

Status Update: EAS Support in K-9 Mail

with 23 comments

After a more in-depth look at ActiveSync support in K-9, I found there to be more issues than I had first thought. This post serves to point out the most major of the issues that I have to tackle before this will be ready to be released into the wild.

1. K-9 does not remember sync state after being restarted. The sync keys used by the Exchange server to know which folders and emails have been synced by the phone are not persisted. This may not be immediately obvious, but it causes K-9 to do a bunch of work it doesn’t need to, which will do a real number on your battery (as well as network usage). This problem has been solved.

2. K-9 does not use the Exchange server to send email. K-9 uses its own “special” outbox for sending email, and it does the sending. K-9 should be moving composed emails into the outbox on the Exchange server, to be sent by the server. UPDATE: My original thoughts here were incorrect. Sending is working correctly.

3. K-9 does not download headers first and then mail contents. It downloads everything in one go. This causes a major delay before mails begin to appear in your message list. I am not sure the ActiveSync protocol is designed for this type of usage. This issue will require further investigation and thought.

4. ActiveSync is designed to filter the number of emails fetched by date, according to pre-defined filters (such as “one month”). K-9 is currently designed to fetch mail differently. The user interface for ActiveSync accounts will need to be modified to match the design used by Exchange.

5. There are discrepancies in the truncation size options for emails between K-9 and Exchange. I am also not certain if it is possible to know if an email is not fully downloaded. This will require further investigation.

I will be tackling these issues 1 by 1 as time allows. At this point, I don’t really have any idea how long it will take me to complete them all.

UPDATES: I have found and addressed a number of additional areas where the design of ActiveSync does not really mesh well with the design of K-9. I won’t go into all the technical details. Syncing of email is now working pretty well. I am now able to use K-9 as my daily email application on my phone.


Written by Kris Wong

December 20, 2011 at 7:33 pm

23 Responses

Subscribe to comments with RSS.

  1. Just compiled ms-eas branch. The ActiveSync account setup says “POP3 Server”. Did you actually want it to say “Exchange Server”?


    December 30, 2011 at 12:25 am

    • It does say “Exchange Server”. If you are seeing “POP3 Server”, then you must have selected to create a POP3 account by accident.

      Kris Wong

      December 30, 2011 at 9:47 am

      • That’s what i thought so started over a couple times, picking the bottom button (ActiveSync). Here’s the screen shot for the dialog that is shown when ActiveSync is chosen:


        December 30, 2011 at 4:02 pm

      • Oh, I know what the problem is. You just need to pull my latest changes. After the last merge of master into ms-eas, there were significant changes to the way K-9 handled account URIs (technical details), and the piece that handles EAS accounts hadn’t been updated yet in response to this. It is now fixed.

        Kris Wong

        December 30, 2011 at 4:11 pm

      • grabbed it from GIT last night. is there something newer or did i do it wrong? New at this stuff.

        know if the new Mail updates for ICS will be rolled in? I’m using it because I need EAS and it’s pretty good, except for no IMAP IDLE.


        December 30, 2011 at 5:16 pm

      • Yes, the fix was pushed about 2.5 hours ago. I haven’t seen mail in ICS, but we support back to Android 2.1, so we can only take advantage of platform features that were available in that version. We also can’t simply cherry pick features from AOSP mail, the API has diverged significantly from K-9.

        Kris Wong

        December 30, 2011 at 5:29 pm

  2. Eureka! I’m logged in to our corp server, using the latest build.

    Thanks for the instruction to a noob! I haven’t coded in 10 years and feeling like a dinosaur. LOL

    Not working with hotmail/ Is that in the works?


    December 30, 2011 at 6:04 pm

  3. Hi Kris: What are your future plans for K9 w EAS? I’m willing to help.

    Dave Cook

    February 4, 2012 at 7:45 pm

    • Dave, right now I am only focused on getting things in shape to be released. If you would like to help, reach out to the development mailing list at: k-9-dev [at] I can fill you in on any details you need to get started. Thanks!

      Kris Wong

      February 4, 2012 at 7:56 pm

      • Thanks, roughly when do you think you’ll release it?

        Dave Cook

        February 4, 2012 at 9:02 pm

      • I am not sure at this point.

        Kris Wong

        February 4, 2012 at 10:34 pm

  4. Hi,

    I wonder if it would be possible to automatically configure the EAS settings in K-9 using scripts? This would be a boon to us as we could distribute the scripts using our mobile device management platform.

    Best regards

    Daniel Hügelmann

    April 2, 2012 at 5:16 am

    • A feature of that sort could certainly be added. However, it would be low on the priority list compared to other features that would benefit a much larger audience. That makes unlikely to be implemented in the foreseeable future.

      Kris Wong

      April 2, 2012 at 7:28 am

  5. Would it be possible, to provide an apk from sources for the guys who aren’t able to build for themselves?


    April 7, 2012 at 5:31 am

    • Once the branch is ready for beta we will begin to provide development apks.

      Kris Wong

      April 9, 2012 at 8:35 am

  6. Hi Guys:

    I don’t know if this will help but I took a first knock at building an Android Email client with EAS. I’ve got a project going over at BitBucket if anyone is interested. (currently private but i can change that). It just needs some testers.


    Dave Cook

    April 9, 2012 at 8:37 pm

    • Would you be willing to help incorporate what you have into K-9 to get into a production ready state?

      Kris Wong

      April 10, 2012 at 7:27 am

  7. Hi, are you close to a BETA release, more than happy to be a guinea pig/tester


    June 14, 2012 at 3:18 am

    • Unfortunately I have not worked on K-9 since January. Other things in my life have been taking priority lately. Since there is no one else interested in working on this, there has been no progress. I do hope to return to it at some point.

      Kris Wong

      June 14, 2012 at 6:05 am

  8. hi,

    I built a debug app using the latest branch from git and get this exception which the playstore version doesnt throw Trust anchor for certification path not found.

    any ideas?


    December 26, 2012 at 7:10 am

    • I haven’t updated the branch with the latest code from master in quite some time, so there are going to be many differences. At this point, the branch is only bit rotting with no hope of completion.

      Kris Wong

      December 29, 2012 at 12:17 pm

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: