Courier-IMAP and “Server XY has disconnected” error messages

If you often encounter error messages like

“Server your_imap.server.org has disconnected. The server may have gone down or there may be a network problem.”

when trying to access Courier-IMAP from an IMAP client (e.g. Mozilla Thunderbird), there are two approaches to solve the problem:

(I) “The real fix”

By default, Courier-IMAP only allows 4 concurrent connections per IP address for clients accessing it. Usually, this isn’t sufficient for modern IMAP clients which cache several connections and hence try to keep several connections opened in parallel. For example, the popular (and recommendable) Mozilla Thunderbird mail client tries to cache 5 IMAP connections by default, exceeding the number of connections allowed by Courier-IMAP by one. This causes several problems, apart from the one mentioned above, Thunderbird may be slow or have trouble to successfully display new e-mail messages at all (i.e. it only displays a white page instead of the content). Now, fixing this isn’t difficult, as long as you have root access to your IMAP server:

1. Edit the configuration file of Courier-IMAP (in my case that’s /etc/courier-imap/imapd) and increase the value of the MAXPERIP setting. For example, I increased MAXPERIP from 4 to 20 (which works fine for me so far):

##NAME: MAXPERIP:0
#
#  Maximum number of connections to accept from the same IP address

MAXPERIP=20

Note that you do not need to add MAXPERIP to the Courier-IMAP-SSL configuration file (/etc/courier-imap/imapd-ssl on my box) as options in the imapd-ssl configuration file augment the options in the imapd configuration file.

2. Then restart your Courier-IMAP server(s). If you run Gentoo like me, just execute

# /etc/init.d/courier-imapd-ssl restart
(and ‘/etc/init.d/courier-imapd restart’ if you also run a non-encrypted IMAP server)

(II) “The workaround fix”

The above “real fix” (I call it the “real” one as Courier-IMAP’s default setting of MAXPERIP=4 is too restrictive nowadays indeed) is only applicable if you have administrator rights on your IMAP server. If you don’t have, you may either want to contact your server’s administrator or decrease the number of concurrently cached IMAP connection in your IMAP client. E.g. for Mozilla Thunderbird, do the following:

1. Open “Tools -> Account Settings…”
2. Select the “Server Settings” of your IMAP account
3. Open the advanced settings dialog by clicking on the “Advanced…” button
4. Lower the “Maximum number of server connections to cache” from 5 (default) to e.g. 2

(For other IMAP mail clients, change the settings accordingly)

BTW If you use Microsoft Outlook, consider setting your mail options according to the following Outlook quoting recommendations (PDF, 225 KB) or rather switch to a better mail client (e.g. Mozilla Thunderbird, Evolution, KMail, .. almost anything but Outlook will do it ;)

See also the following post by Omar Shahine (Architect of MS Entourage‘s IMAP support) on IMAP, Thunderbird, and mail clients: Entourage earns an A-, Outlook a D+, Outlook Express a C, Windows Eudora a F and Mozilla Thunderbird a B+ :) His executive summary:

“Thunderbird is an almost perfect IMAP client for Windows. If you use IMAP, this is the product for you.”

In any case, have fun! :)

Manually resetting services on Gentoo

Jboss 3.2.3, which runs on my box, crashes about every 24 hours. This would of course be a huge problem for a production quality system, not for a prototyping-only installation such as mine though. Nevertheless there’s a problem. As soon as I stop Jboss by executing “/etc/init.d/jboss stop”, Jboss fails to shutdown properly. Restarting the jboss service afterwards doesn’t work as the start script wrongly assumes that jboss is still running. Fortunately, there’s a way to manually reset the state of services in Gentoo. For Jboss, just do:

# /etc/init.d/jboss zap

Afterwards you can restart Jboss by executing

# /etc/init.d/jboss start

NX bit, Exec-shield, PaX, W^X, DEP etc.

There’s a very insightful article on the NX bit on wikipedia.org explaining the differences of the approaches of Exec-shield, PaX, W^X and DEP:

Wikipedia: NX bit

AFAIK, the entry for DEP is not quite correct (“Emulation: No”) as DEP can emulate the NX bit on CPUs that don’t support it.

Hint: If you plan to buy a new computer, it’s probably wise to make sure it has a CPU supporting the NX bit (e.g. AMD64) as both Linux 2.6.8+ and Windows XP SP2+ can now take advantage of it.

IBM models for Neptun IV announced

IBM models for Neptun IV – autumn/fall 2004 (Neptun site)

I think IBM’s notebooks are better than my current notebook/TabletPC m200 by Toshiba. Some quick notes about the IBM notebooks above:

IBM X40:

+ small, lightweight
+ SD card reader
+ long battery runtime
+ Bluetooth
– relatively weak CPU, only a 1.2 GHz Pentium M (not a Dothan core)
– small HDD
– very weak graphics chip (Intel Extrem Graphics 2)
– no DVI out (only VGA)
– bad design (tapered/slanted bottom/keyboard)
– no external drives included
– has a trackpoint, but no touchpad

IBM T42 medium:

+ nice and fast CPU (Pentium M 735 Dothan)
+ Bluetooth
0 CD-RW/ DVD-ROM Combodrive (adds weight; should be a DVD+/-RW nowadays)
0 moderate weight (neither lightweight nor very heavy)
– small HDD
– low resolution screen (only 1024×768 even if it’s 14.1″)
– average GPU (ATI Mobility Radeon 7500/32 – equals in about a Nvidia FX Go 5200, but without DirectX9 support)
– short battery runtime
– no DVI out (only VGA)

IBM T42 large:

+ nice and fast CPU (Pentium M 735 Dothan)
+ Bluetooth
+ high resolution screen (1400×1050/14.1″ ideal! – 1400×1050 is more adequate for a 14.1″ than for a 12.1″ screen such as with my Toshiba M200)
0 CD-RW/ DVD-ROM Combodrive (adds weight; should be a DVD+/-RW nowadays)
0 moderate weight (neither lightweight nor very heavy)
0 average/large HDD
0 long battery runtime (though only thanks to a 9-cell battery pack)
– fast GPU (ATI Mobility Radeon 9600/64 – drawback: demands a lot of battery power. IBM should have included the ATI Mobility Radeon 9700/64 like Apple with its Powerbooks. The 9700 uses less power and is even faster than the 9600.)
– the 9-cell battery pack increases the depth of the notebook (huh? despite of a decreasing battery runtime, they should have rather used a standard size battery pack IMHO)
– no DVI out (only VGA)

I’m curious how the Apple models will look like. The biggest plus of an Apple Powerbook is probably its nice overall design and well-balanced, powerful functionality and of course MacOS X (which is the only truly user-friendly OS at the moment). The biggest minus is the fact that everybody is expecting a soon release of 1.) a dual-core G4 Powerbook 2.) a single-core G5/64bit Powerbook. So people eventually decide to wait another half a year.

Registration opened for OSCOM 4 in Zürich

OSCOM – OSCOM 4 in Zürich, Switzerland (Sept 29th – Oct 1st, 2004)

I attended OSCOM 1 back in 2002 which I remember as an interesting and “crispy” conference. I’m not sure whether I’ll have time to attend OSCOM 4 though. Further there aren’t any student/early bird discounts (a somewhat strange marketing policy for a) a OSS community event and b) considering that ETH is a public university). A wise decision? We’ll see..

(via Gregor)

XP SP2’s Data Execution Prevention and Performance Hits

Did you notice a severe performance decrease after having installed Windows XP SP2? You’re not alone. Unfortunately, I lack the time for an in-depth performance comparison of XP with and without SP2. So I just ran the demo benchmark of 3DMark2001, once with SP2’s new Data Execution Prevention (DEP) enabled, once disabled (I rebooted my box before running each test).

3DMark2001 results on my box (higher values are better; the absolute values don’t matter here unless you’re interested in the absolute 3DMark2001 performance of a Toshiba Portégé M200 with 768 MB of RAM):

XP SP2 with DEP disabled (AlwaysOff): 4601
XP SP2 with DEP enabled (OptOut OptIn, i.e. the default setting for SP2): 3299

Oh my! I did expect a performance decrease, but not such a big one! And it’s even a 3D benchmark (“normal” application benchmarks might even show worse results for DEP)! So, according to these measurements (don’t quote these measured results please; they’re statistically not significant as I haven’t measured a series of test-runs, only one run per test), enabling DEP (enabled by default after installing XP SP2) results in almost 30% lower 3DMark2001 performance! It’s your choice whether the improved security of your box is worth this huge performance hit. For a server it might be (it’s still alarming though), but for my M200 TabletPC, it definitely isn’t. If you like to disable it too, here’s how to do it:

1. disable write-protection of c:\boot.ini (see the properties dialog)
2. in c:\boot.ini, replace “/NoExecute=OptIn” by “/NoExecute=AlwaysOff” using a text editor (e.g. notepad)

Further details about how to enable/disable DEP on a per-application basis are explained on this page at microsoft.com.

PS. Note that a similar execution protection for Linux, Ingo Molnar’s exec-shield, affords a performance decrease of a few percents only. I really wonder how MS managed to burn that many clock cycles..