Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
86 lines (42 sloc) 4.4 KB
Feb 23, 2010
I've redone how the tests are run. LBIMAPConnectionTests no longer runs the python script- instead it uses LBTestIMAPServer, which listens on port 1430 and also prints out files from a plist. So for instance, the testBadLSUB method tells it to load up testBadLSUB.plist, which contains a bunch of expected values from the client (which it tests against) and a bunch of commands to send out. If the incomming client commands don't match up right, we crash (because of runloops and such, I can't currently throw an exception. I probably should figure this bit out though).
Besides being able to test for correctness in the client commands, having the local server and not having to spawn an extra process means faster running tests. Which is good.
Feb 21, 2010
Hey- I've added some new tests for basic IMAP connection stuff.
It goes like this:
LBIMAPConnectionTests has some methods in it, we'll use "testListSubscriptions" as an example.
GHUnit runs testListSubscriptions, which runs a python script (from NSTask) named "". Open up that guy, it's basically a script of server responses. So we load up that script, it opens up on port 1430, and we then connect to it with our imap connection, and do stuff.
Since everything with LB is done with blocks, we run the connection on the main thread so the test thread doesn't freak out because of runloops and such. Plus, our response blocks are always called on the main thread anyway. There's some funky macros in there to help with setup and teardown of that stuff.
It should probably also validate that what we're sending is good. But it doesn't currently.
Anyway, that's what was worked on today.
Feb 17, 2010
Hello. I'm back from vacation. Yes, it was fun, thanks!
I've added a new class "LBTCPConnection", which inherits from MY's TCPConnection, which is then subclassed by IMAPConnection, and a new class named SMTPConnection. You can guess what it does.
I've also reworked how the reading of data is done. Previously, when data was available the connection class was sent a canRead: message from the reader class. No longer- now you setup a block for the reader to call back, which keeps things a bit more organized in the connection classes, since you no longer need a big old' list of if else blocks to figure out what to do.
Fun times.
Feb 3, 2010 AGAIN
Ok, we're doing the SSL thing now, plus a gmail fix for listing mailboxes.
Feb 3, 2010
Crashy will now download messages to it's cache, so you don't need to use the python script to load it up.
Right now, SSL support isn't working. It'd be great if someone could look through the TCPConnection classes and figure out how to hook it up.
Feb 2, 2010
You still need to download all your messages and setup the cache.
However, I've added an experimental imap client class to LetterBox (built on top of Jens Alfke's MYNetwork classes: ), which does a handful of things currently:
Connect, login, list mailboxes, create mailbox, delete mailbox, subscribe, unsubscribe, select mailbox, and list messages in mailbox.
If you hit the "get more mail" button, it'll print out a list of the mailboxes, but doesn't currently update anything.
I'm thinking that it might be better if we write our own IMAP library, which has lots of hooks for GCD + blocks. Of course, I say this only have written a fraction of what needs to be done so far. Luckily, since the imap library is never exposed outside LetterBox, it's easy to swap in different implementations.
The code is very very messy right now. It's still just a big sketch of ideas floating around in my noggin.
Jan 30, 2010
So right now, Letters is no longer pulling data from an imap server.
Instead, you'll need to run in the bin directory like so: username password imapserver
It connects to port 993 by default via SSL, and downloads the messages to Letters's message cache. The next time Crashy launches, it'll see the cached messages. It'll still crash though. I PROMISE!
Your prefs in Crashy need to point to the same server as well, so it knows where to look in the message cache.
If someone wants to stup up and take care of IMAP stuff, let me know. I added some pyobjc code that crashy was bridging to, but GCD and blocks are out with this, which blows. It's checked in, but it's not compiled in currently (LBPYIMAPConnection,