David accepted my proposal on Friday afternoon, and I'm going to spend up to a week making multiple, simultaneous IMAP connections work. If that time period is exceeded, our risk management plan is for me to bail and revert to a single-connection model. Today, I'm beginning by restructuring my connection code and modifying generic.c. A little more design work will probably also be necessary.
All the IMAP connections will masquerade as one connection from the perspective of the server engine, and commands will be fully serialized. As it turns out, the timeout code will work unmodified, but the login code, the forced shutdown code and most especially the warning code will need close work. As always, my goal will be to leave existing code alone as much as possible, because it all works quite well and breaking it would require extensive QA work before we could load it back up for 10,000 users.
Oh, and I might agitate about CVS a little bit if I need a break. =)