Tuesday, January 31, 2006

Using a Window Mobile 5 Phone as Bluetooth Modem with Mac OS X

Lots of folks (including myself) have been pulling their hair out trying to get mac OS X to use a WM5 mobile phone as a bluetooth modem. Here is what I did to get it to work with my QTEK 8300:

1) Download the modem script for IPAQ PDAs from Ross Barkman's page

2) Uncompress the archive

3) Copy the iPAQ GSM script to Library/Modem Scripts

4) Select Network under System Preferences

5) Select Bluetooth and click Configure

6) Under PPP options turn off TCP Header compression

7) Select Bluetooth Modem, then select the "iPAQ GSM" modem script, and disable the error correction and compression in modem

8) I am a T-Mobile USA subscriber so I entered *99# as the telephone number. T-Mobile does not require a username or password; however if you don't provide them, the mac and remote PPP server will flail on authentication. So I just entered a bogus value for my username/password

9) Click dial now

10) Click connect in the dialog that pops up

You should be good to go.

*To diagnose errors: select "verbose logging" under PPP Options, then using Terminal, tail -f /var/log/ppp.log, then try connecting. You should see lots of useful diagnostics

Thursday, November 03, 2005

Ajax Was Just a Detergent

When we started in late 2003, AJAX was just a detergent. I recall that I was experimenting with HTML and JSPs for a side project on which I was working. I should note that back then we had a prototype client that we had written in Java that was based on SWT - the UI toolkit used in Eclipse - that we were using to demonstrate our vision to the investment community. The reason I bring this up will shortly become apparent.

Being a long time server programmer (though a one time X Windows hacker), I knew very little about HTML beyond headings, lists, and basic tables. I had heard of a technology called DHTML that allowed web pages to be more dynamic and was intrigued by it, but that was about the extent of my exposure. I was due to spend a couple of weeks out of town, so I resolved to spend the down time learning more about HTML, DHTML and related web technologies. The first thing I did was to stop by a bookstore and literally buy all of the books I could find on HTML, DHTML, CSS, and JavaScript (thank you Tim O'Reilly!). Between reading and experimenting, I discovered the power afforded by manipulating a documents DOM with JavaScript. It quickly became quite clear that if the browser could sustain it, then it was possible to do some really complex and rich user interfaces. I wondered how complete an application platform the browser could truly be. Could it in fact support a "standalone" client - much like current desktop clients?

There were some obvious missing pieces one of which was the network programming stack. After some quick searching, I came across Brent Ashley's JavaScript Remote Scripting library (JSRS). A quick look showed that it would work as a poor man's RPC. Another missing piece was a UI toolkit that provided among other things an extensible widget hierarchy that supported components like trees, labels, buttons, and lists, as such components would be repeatedly used in applications. It also became apparent that we would need a browser independent event model to not only support UI events but that would also support applications developed based on the MVC (Model/View/Controller) paradigm. Finally, it would be of paramount importance to isolate browser differences as much as possible.

Truth be told, the last thing I wanted to do was write a UI toolkit; however, after some searching, I could not find an [free] extensible cross browser UI toolkit that provided the components, component architecture, and extensibility that I felt was needed. As I stated earlier, we had developed a prototype client based on SWT and so having most recently worked with it, I was familiar with it's architecture and implementation, I therefore decided I would build a toolkit loosely based upon it. I ended up call this toolkit DWT for "DHTML Widget Toolkit" - which today is a part of the broader toolkit known as the "Zimbra AJAX Toolkit".

The first task at hand in developing DWT, was to build the component infrastructure. I tried to implement the minimal set of functionality required to realize concrete components while still providing a framework that was realistic. I decided that my first task was to build enough of a framework to create a label, derive a button from it, tie it all into a generic event model and show it working. If I could get that far and validate my premises, then I would go back and fill in the infrastructure. Once this was in place, we could then extend DWT and develop components on an as needed basis.

By this time I had returned to California and was eager to show the team what I had been up to. As a quick aside, I told Roland my reservations about using JSRS as a foundation for the network programming layer. About fifteen minutes later he came back to me and pointed out that there was a cross browser component called XmlHTTPRequest though not as platform independent as JSRS, was nonethess more suited to the type of network programming we wanted to do, and was supported by the browsers that we cared about. I must admit to feeling quite foolish for not having discovered it myself :-)

We did all had some serious reservations about how far the technology could be pushed. Would the browser fail under the load? Could it handle the kind of complex DOM and JavaScript code we would be throwing at it? Concerns aside, the team realized that if this worked, it could make a big difference in the marketplace. We could highlight the power of our collaboration server's features while at the same time provide a zero-footprint client that could not only approach the flexibility of a desktop client, but also exceed it in certain ways. We felt the time had come for really compelling web applications and that modern browsers were perhaps up to the task of supporting such applications.
At the same time, we did some experiments to figure out just how far we could push the browser as an application platform. The results were encouraging; however, there was only one way to really find out if this was all possible, and that was to build our application using the technology.

We started building the Zimbra Collaboration Suite's (ZCS) AJAX client in lockstep with the server. As soon as server features were completed and their SOAP APIs made available, we would wire them into the client. Since we were trying to adhere to the MVC paradigm, we could develop features in parallel by creating models on the client that would return dummy data. This data would then be replaced with live calls to the server once the SOAP APIs for the feature were available. In this way we were able to grow our system organically. By this time, the client engineering team had added several great engineers who are a lot smarter and faster than I. With them on board the client started making big strides forward.

I should reiterate that while we were always set on building a collaboration system we never set out to build an AJAX toolkit. We simply ended up with one out of necessity.
In fact the toolkit grew out of the needs of our clients - plural because we implemented our administration console using the same technology - and pretty soon it resembled a more general SDK than just a UI toolkit. Not only were there the DWT UI components, but there were also packages for network programming, XML processing, SOAP, event handling, utilities... The list goes on.

In developing the ZCS, we have from the very start tried to continuously push the envelope. This has resulted in some painful lessons, as well as some long nights and weekends. I am really excited by the work that the team has done and continues to do. Getting the first Beta release of the ZCS out the door was a really satisfying step along the road. The reception that it received from the community has been overwhelming. I can promise that we are working on some very exciting and cool features that we cannot wait to release to the community.

Tuesday, November 01, 2005

Is Zimbra Just a Web Client?

Absolutely and most definitely not!

The Zimbra Ajax webclient is just one way to access the Zimbra Collaboration Server. I have to admit that it is the one I almost always use because I am totally hooked on the conversations, search, and calendar features. I basically never throw any email away anymore. I also like the fact that I can access it from anywhwere on any Machine with a supported browser. However, all of the capability that is provided in the client is for the most part realized by the server. In addition the server supports IMAP/POP clients, as well as iCAL clients.

Another cool fact is that all the APIs that the client uses are public SOAP APIs that are documented in the product source code download. I would love to see other folks write clients against the ZCS server. These could be full blown collaboration clients, or just utility clients like OSX or Konfabulator Widgets. Greg, one our key engineers, has written a mobile flash client that runs on a PocketPC. It supports such features as conversations and autocomplete on compose. It also syncs calendar appointments from the ZCS calendar. All in all it is pretty sweet. Greg runs it on his PocketPC phone and uses it all the time as do a several other folks at Zimbra

Sunday, October 30, 2005

Zimbra IMAP4/POP3 Standard Support

The Zimbra Collaboration Server comes with its own IMAP4 and POP3 server that is tightly integrated into the core server.

IMAP4 Server



The IMAP4 server supports the following standards and extensions:

[IMAP4rev1] RFC 3501: IMAP4 - Version 4rev1
[LOGINDISABLED] RFC 3501: IMAP4 - Version 4rev1
[STARTTLS] RFC 3501: IMAP4 - Version 4rev1
[CHILDREN] RFC 3348: IMAP4 Child Mailbox Extension
[ID] RFC 2971: IMAP4 ID Extension
[IDLE] RFC 2177: IMAP4 IDLE command
[LITERAL+] RFC 2088: IMAP4 non-synchronizing literals
[LOGIN-REFERRALS] RFC 2221: IMAP4 Login Referrals
[NAMESPACE] RFC 2342: IMAP4 Namespace
[QUOTA] RFC 2087: IMAP4 QUOTA extension
[UIDPLUS] RFC 2359: IMAP4 UIDPLUS extension
[UNSELECT] RFC 3691: IMAP UNSELECT command
[$MDNSent] RFC 3503: Message Disposition Notification (MDN) profile

SASL support and ACL support are high on the list of extensions we want to support next.

Some interesting things to note about the IMAP server:

  1. Support for unsolicited responses from the IMAP server works out quite well, due to our server's internal session/notification framework.
  2. IMAP searches via the SEARCH command are translated on the server-side to our search query language and run like normal search queries (although it appears most IMAP clients generally do client-side searches).
  3. In the Zimbra web client you can create what are known as "saved search" folders. For example, you can create a saved search folder called "From Stanford" that consists of messages matching the query: "from:@stanford.edu". The query is run whenever you "open" the folder by clicking on it. When you login to the IMAP server and list the folders, you will see a folder called "From Stanford" that does the same thing.

  4. simultaneous access from multiple IMAP clients and/or IMAP and web clients is also allowed and encouraged!


POP3 Server



The POP3 server supports the following standards and extensions:

RFC 1939: Post Office Protocol - Version 3

supported: DELE, LIST, NOOP, PASS, QUIT, RETR, STAT, TOP, UIDL, USER
unsupported: APOP (optional, and requires clear-text password to be stored)

RFC 2449: POP3 Extension Mechanism

supported: CAPA, TOP, USER, UIDL, EXPIRE, IMPLEMENTATION
unsupported: SASL, RESP-CODES, LOGIN-DELAY, PIPELINING

RFC 2595: Using TLS with IMAP, POP3 and ACAP

supported: STLS


SASL support is in the pipeline.

POP3 Easter Egg


An interesting "Easter Egg" within the POP3 server is you can access folders other then the INBOX. In fact, you can run any Zimbra search query if you 'd like. This works with any standard POP3 client. How, you may ask?

Normally when you login, you specify a username/password like (POP protocol-level):

openssl s_client -host localhost -port 995
+OK g5.local Zimbra POP3 server ready
USER user1
+OK hello user1, please enter your password
pass test123
+OK server ready

If the username ends with "}", and also contains a "{", then the string between the two braces is used as the search query to build the "virtual" INBOX. For example:

+OK g5.local Zimbra POP3 server ready
USER user1{folder:bugs tag:p1}
+OK hello user1, please enter your password
pass test123
+OK server ready


When logging with the username of "user1{folder:bugs tag:p1}" , your POP3 client will see all the messages that you would normally see in the Zimbra web client if you had typed "folder:bugs tag:p1" in the search bar. That is, it will find all messages in the "bugs" folder that are also tagged with the "p1" tag.

Most POP3 clients allow you to setup multiple profiles, so it is fairly easy to configure a POP3 client to let you sync both your INBOX and other folders/searches as well.

Server Source



The list of standards and extensions we support is also available in the source tree at:

ZimbraServer/docs/pop-imap.txt


Since we are Open Source, the source for the IMAP4 and POP3 servers is also available and located within the source tree at;

ZimbraServer/src/java/com/zimbra/cs/imap/*.java
ZimbraServer/src/java/com/zimbra/cs/pop3/*.java


Please visit our forums if you questions comments!

Friday, October 28, 2005

Plug for The New Zimbra Shared Calendar & Admin Console

At Zimbra we fundamentally believe in "eating our own dogfood", that is running our business on our own software. So as soon as our new shared calendar was ready to go, the whole company started using it.

Needless to say we are really pumped about it. In fact, Janie, our office manager and without question the most important person at Zimbra, can now efficiently schedule events in all of our calendars. This makes her happy, so happy that she gave all the developers a big hug! I can tell you all that we like it when Janie is happy, because if Janie is not happy, Zimbra is not happy!


But shared calendaring is only the start. We have also added the ability to import iCAL calendars into Zimbra. For fellow Mac user's out there, you can now import your iCAL calendars into your Zimbra calendar. This includes publically available iCAL calendars like those found at apple's
website. As soon as this feature was ready I imported a couple of my favorite calendars: The Formula 1 racing calendar, and the US Holidays calendar. To see some of the work we have done on our calendar check out the screenshots on Kevin Henrikson's blog

Calendaring is not the only application we have been spending time working on. The administration team has also been really busy working on the Zimbra Admin Console. The console, which is built on the same technology as the Zimbra collaboration client, has a new look and feel that is aligned with that of the collaboration client's. In addition, we have added a number of cool new features to make the admin's life alot easier. You can see a few screenshots of the new console
here.

These are just a few of the features we have completed and which will be available for download shortly. We also have lots of new and innovative work in the pipeline that we will be providing in future releases of our product, so stay tuned!


Thursday, October 27, 2005

From C/C++ to Java

In 1999 when we were architecting and implementing Onebox.com, we had to select an implementation language. Given that all the principle architects at Onebox were from JavaSoft, so one would expect Java to be the natural choice. It was not.

Before going further, I should perhaps write a little about Onebox.com. Onebox.com was a unified messaging startup back in the Dot Com "gogo" days. The idea was to provide subscribers with a phone number and a web based "inbox" from whence they could get their email, voicemails, and faxes. So when a subscriber registered, they could pick a phone number in an area code, pick a user name and they were in business. The basic service was free, and the premium services (such as phone numbers without extensions, more disk, multiple phone numbers) were add on. The service did quite well and we were servicing over five million subscribers by the time we got acquired in 2000.

Given the requirements of Onebox (millions of users), we had to ensure that our architecture and its implementation would scale. When we balanced out all the requirements for an implementation language, we ultimately selected C/C++. Quite frankly, at the time it was not a difficult choice. We knew then that Java was simply not mature nor robust enough to support the kind of RAS (reliability, availability, scalability) requirements that we had before us. Back then, the JVM was not relatively performant, and was known for consuming lots of system resources and requiring frequent restarts; moreover, stability was not its hallmark and it was not uncommon for the JVM to crash.

Much has changed in the past six years. Today many of the same engineers that were members of the Onebox team are a part of Zimbra (including Anand Palaniswamy who worked on Java VMs at JavaSoft and BEA). This time around we did elect to go with Java. Given Java's maturing over the years, we think its benefits far outweigh its costs. For example, the nature of the problem that we are solving is not sensitive to the small latencies introduced by garbage collection cycles (unlike say a voice gateway application) nor are we dealing with a compute bound problem (e.g. like an image processing application). Given these parameters and the fact that the problem we are solving is typically I/O bound, we chose Java.

Our performance tests have shown to us that in fact, the JVM is not at all in the critical path and on the whole we feel that our choice is validated. I will add that careful tuning of the JVM parameters is very important to ensuring the right runtime characteristics for the VM for any given application. I will be writing more about this later.

One of the key benefits of using Java is that it really cuts down development time. There is no way Zimbra would be where it is today if we had developed using C/C++ (and I am a big fan of C!). For example, there are so many Java packages available to help solve many of the tasks that we seem to write code for over and over again each time we embark on a new project - there are even good packages available for more esoteric tasks. Another nice benefit of using Java is that nasty buffer overflow and memory corruption problems goes away; however, memory leaks do not!

Of course, like everything else, Java is not perfect. Like any tool it has it weaknesses, and like any tool it has it appropriate and inappropriate uses (never use a hammer when the jobs calls for a screwdriver). Here are some of the bad:

As I said previously, there are packages available to solve just about any problem. It is really easy to grab them and introduce them into a product. The problem is that some of these package may be poorly implemented. This means you have to do your homework. Review the code (if available), definitely benchmark it: See how much memory it uses, how many disk cycle does it use (if it does I/O), what kind of cpu usage characteristics does it have? If you fail do take the time to do this work, you will pay a big price, and you will often learn of the price way too late in the development cycle

It is really quite easy to write inefficient code in Java. Because Java provides some nice abstractions, it is easy to lose sight of what is going on under the covers, and it's a topic that has been discussed extensively on the web and in books.

Let me give you one specific example of how we were surprised to find some inefficient code, and we we consider ourselves very Java savvy! Our hosted demo code, which provisions and expires users on the fly, was leaking memory. While we were heap profiling it to find the culprit, we were noticing an extraordinary number of int[], Matcher and Pattern objects were being allocated very rapidly. These were not leaking, but still seemed strange. We found and fixed the memory leak. But we also made sure to optimize places where the demo code called String.replaceAll() and String.split() - these methods create and compile regular expressions on the fly. The simple lesson here is to ensure that you compile regular expressions once and use them over and over again, but the larger lesson is that something that looks innocuous during a long night of coding, such as String.split(), might cause you problems later. Know your abstractions.

We also found a few places through code review (these were not in tight loops or critical paths - or we would have found them earlier because we profile the core server code all the time) where we were using String.split() when a simple String.indexOf() would have been more than sufficient. For kicks, we wrote a small test (yeah, yeah, I know micro benchmarks suck, but I couldn't resist the temptation), and it shows how you can be 15x as expensive without knowing about it.


$ cat Test.java
import com.zimbra.cs.util.EmailUtil;

class Test {
public static void main(String[] args) {
final int N = 1000000;

long start = System.currentTimeMillis();
for (int i = 0; i < N; i++) {
String s = "haha@haha.com".replaceAll("@", ":");
}
System.out.println("replaceAll: " + (System.currentTimeMillis() - start));

start = System.currentTimeMillis();
for (int i = 0; i < N; i++) {
String s = "haha@haha.com".replace('@', ':');
}
System.out.println("replace: " + (System.currentTimeMillis() - start));

start = System.currentTimeMillis();
for (int i = 0; i < N; i++) {
String s[] = "haha@haha.com".split("@");
}
System.out.println("split: " + (System.currentTimeMillis() - start));

start = System.currentTimeMillis();
for (int i = 0; i < N; i++) {
String s[] = EmailUtil.getLocalPartAndDomain("haha@haha.com");
}
System.out.println("indexOf/substr: " + (System.currentTimeMillis() - start));
}
}

$ zmjava Test

replaceAll: 3529
replace: 211
split: 3398
indexOf/substr: 208



This is not to say that regular expressions are bad or that all object
allocations are bad. As they say, everything in moderation and use it right.

There is a common perception that Java does away with the need to think about memory management. WRONG! while you cannot corrupt memory via such things as out of bound memory writes, you can still cause the system to leak memory like a sieve. So developers need to think carefully when they are writing their code. Are you holding on to object references when you no longer need them (a classic example is keep around hashes and vectors that have hundreds of object references contained within them)?

The bottom line is that while Java is a tool like any other language. It has it strengths and it has its weaknesses. We felt that it performance characteristics, along with its ability to accelerate development made it the right tool for developing the Zimbra Collaboration Suite. On a final point I would recommend anyone doing serious Java Development to invest in a copy of Josh Bloch's "Effective Java Programming Language Guide"

(Thanks to Anand Palaniswamy for contributing to this blog!)

GUIs and CLIs and APIs, Oh My!

When designing a server (or a group of servers that comprise an overall system, like a mail system), I think it is very important that all server functionally is exposed via three (really four) mechanisms:

  1. GUI (Graphical User Interface)

  2. CLI (Command Line Interface)

  3. API (Application Programming Interface



Each one has its place. GUIs are very nice for a certain class of users, and for doing tasks like browsing configuration information, looking at statistics, monitoring, and tweaking attributes. Where GUIs start to fall flat is when you need to do perform a bunch of operations in bulk, or you need to automate things that run in a script or out of a cron job. For that, it is much easier to have a command line interface.

The command line interface should have a number of properties:

  • It should have a very regular naming structure, and consistent options

  • It should generally have easily parsable output, so other programs can use the output

  • It should always set a meaningful exit status



But, there are also times where a command line interface doesn't work well. For example, say you want to write a PHP script that provisions new users in a mail system. You could exec a command line program and parse the output, but it would be more efficient (and ultimately more stable) to be able to call into the API to create an account, deal with error codes pragmatically, etc.

I mentioned there were actually four mechanisms, not three. The fourth is providing an API via the network. This can be via ONC RPC, SOAP, XML-RPC, simple HTTP POSTs of forms, etc. The important thing is providing the same functionality that your APIs provided via the network, so calls can be made server-to-server, client-to-server, etc.

Now lets examine something like creating a user in the Zimbra Collaboration Suite.

You can create a user using our admin interface. Simply point your browser at the ZCS administration interface, which itself is an AJAX client that looks exactly like our ZCS web client. Screen shots coming soon.

You can also create a user using the command line tool, zmprov:


zmprov createAccount smith@company.com mypassword displayName "John Smith" zimbraImapEnabled TRUE


If you don't want the password showing up on the command line, you can also run the program interactively and/or feed it a batch of commands via stdin.

You can also create a user by writing a Java program:


Provisioning prov = Provisioning.getInstance();
Map attrs = new HashMap();
attrs.add("displayName", "John Smith");
attrs.add("zimbraImapEnabled", "TRUE");

Account acct = prov.createAccount("smith@company.com", "mypassword", attrs);


And, you can also create an account via SOAP:

<soap:Envelope xmlns:soap="...">
<soap:Body>
<CreateAccountRequest xmlns="urn:zimbraAdmin">
<name>smith@company.com</name>
<password>mypassword</password>
<a n="zimbraImapEnabled">TRUE</a>
<a n="displayName">John Smith</a>
</CreateAccountRequest>
</soap:Body>
</soap:Envelope>



Hopefully, that looks fairly simple, and get the point across:


  1. Don't hold data hostage.
  2. Don't make an expert click 20 times when they can type the same thing in 2 seconds into a CLI.
  3. Don't make them screen scrape when they can call a web service instead.
  4. Try not to expose something via one mechanism without giving users a way to do it via another.


Above all, Keep It Simple Stupid.

Wednesday, October 26, 2005

SOAP? Why SOAP?

When we started designing the protocols into the server. We thought about what protocol to POST to the server. In general, I think SOAP is very heavyweight, but mainly when using RPC-Style SOAP. Document-style SOAP is actually fairly lightweight.

What if you wanted to use XML, but not SOAP. You might have something simple like:

<CreateFolderRequest>
<folder name="...."/>
</CreateFolderRequest>

How much extra work is it to make that a document-style SOAP request?

Not much, really:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<CreateFolderRequest>
<folder name="...."/>
</CreateFolderRequest>
</soap:Body>
</soap:Envelope>


That is it. Not much extra baggage, and you have a document-style SOAP request.

BTW. Parsing large XML responses in a browser can be very slow. Our server lets you post requests in SOAP, and get them back in JSON. The client then just evals the JSON.

Was It Always Called Zimbra?

No.

It was late 2003 and we had all just quit our jobs to go do a startup. At the time we were hanging out in the incubation suite at Redpoint Ventures where Satish was an EIR (Entrepeneur In Residence). After a couple of initial meetings, we quickly realized that we needed a company name so that we could make some T-Shirts. So after a little late night IM brainstorming we came up with the name Liquid Systems. And that was the name of the company - Until quite recently when it was brought to our attention by our crack legal staff that "Liquid" is not a trademarkable name - not a good thing. (Another no good thing was that Googling Liquid Systems would display www.liquidsystems.net as the first hit. This website belongs to Pattison Liquid Systems, Inc. "Your Liquid Fertilizer Experts")

And thus began the great naming quest.

I cannot begin to tell you how painful it is to come up with an unique yet catchy company name. Either the name is taken or all the domains are taken. We tried for months. Everyone in the company contributed suggestion. We had hundreds of them. Some good, some bad, some plain awful, but none of them were "it". One night I sent John Robb (VP of Marketing) a list of name suggestions. I was not convinced that he was really reading the suggestions being sent to him, so I sprinkled some bogus names I got from a name generator on the web among the thirty of so legit names I had collected. One of those names was oompahzing. The moral of the story is never try and screw with a marketeer. Not only was I humilated at the next company get together for my "brilliant" suggestion, but my the nameplate on my cube, as well as a conference room at Zimbra read: oompahzing. In honor of John's practical joke I have named this Blog oompahzing - I will however get my revenge.

So how did we end up with Zimbra? Well one day David Byrne of Talking Heads fame showed up at our offices in San Mateo and said that he had heard from a friend that we were looking for a new name for our company. He suggesed that "Zimbra" would be a great name, and even offered to perform at the company holiday party this year - which pretty much clinched the deal.

Ok, really how did we end up with Zimbra? The truth is that Scott Dietzen suggested it to Satish, who being a huge Talking Heads fan, jumped on it and saved us from some really really bad ones. Scott Dietzen actually has a pretty good blog on the Zimbra website about it which you can read here

Why another server?

People often ask us "Why another server?". Why not just use Cyrus IMAP? Short answer is we wanted to design a server from the ground up, with tightly integrated indexing, security, web services APIs, multi-protocol support, client synchronization between all those various protocols, server-side extensions and hooks, calendaring, contacts, etc.

We'll go over these in more detail in coming posts. But let me start with one very important: client synchronization.

What do I mean exactly? Imagine if you could use a web client, IMAP client, and Outlook (with a MAPI connection that talks our SOAP protocol), and if you delete a folder, mark a message as read, etc, then all three clients (all active) updated simultaneously!

Imagine the same thing via two web browser. You create a folder in one window, and in the other window (say Firefox one window, IE in the other) the folder automatically appears. How is this done?

There are two important things happening:

1) our SOAP protocol piggybacks notifications in SOAP responses. Ask the server for an inbox listing, and it will return you the results in the SOAP body, but in the SOAP header, we'll tack on interesting tidbits, like if any folders were created, or if a message was deleted, etc. The AJAX client handles all these notifications and updates it state.

2) On the server-side, all active clients (IMAP, SOAP, etc) maintain a session with in the server. All access to the mailbox happens through the Mailbox class in the server. Any changes made are then added to active sessions, and returned to the clients next time the make a request. IMAP allows for unsolicited responses. Our AJAX client (as mentioned) above gets piggybacked notifications in the SOAP header. The AJAX client also does a NoOp SOAP call every so often just to keep the session alive and get back any pending notifications.

The whole system works amazing well, and was designed/implemented by Dan Karp, one of our core server engineers and architects.

More details are available in our source tree, available via:

http://www.zimbra.com/downloads/

Checkout ZimbraServer/docs/soap*.txt for more info!

Hello World (or a Zimbra is born)

Hello all!

I am one of the three cofounders of Zimbra (www.zimbra.com) . The other two cofounders are Satish Dharmaraj and Roland Schemers. I have known Satish since 1997 when we worked at JavaSoft together. In fact I remember him interviewing me for a position there (at the time I was working on Neo, Sun's CORBA implementation, at SunSoft, but that is another story!) During the interview Satish asked me lots of questions about threading, like what is priority inversion etc. All the while Nine Inch Nails were playing on his office stereo - we have been friends ever since. In early 1999, Satish and I went to a startup called Onebox.com. There, I met Roland and we worked together on designing and implementing a chunk of the system architecture. Roland was also at JavaSoft where he was responsible for a bunch of the JDK's security framework. I have to say that Roland has mad hacker skills - one of the best I have known, though he still is not as good as me (ok - just kidding).

So why am I writing this blog?

I have had so many friends, family, and even strangers as me about Zimbra: What's it like working here, how was it founded and how did we decide on doing a collaboration system, how did we get into doing AJAX... the list goes on. So I thought it would be cool to chronicle the past, present, and future or Zimbra (including a smattering of random ramblings about and brilliant insight into the tech industry). It has been a great journey so far and I look forward to sharing it with anyone who is interested. I will also promise to reveal why the name of this blog is oompahzing ;-)