2003-03-18

Limiting memory use of courier-imap with softlimit

I was hit by what seemed to be a bug in courier-imap. It all began a few weeks ago when I tried to synchronize the IMAP account at my home server. The server runs FreeBSD 4.7 and courier-imap. I use Apple's mail client.

Suddenly an operation I perform several times a day failed; the sync hanged at the mailbox selected for storing outgoing mail. Or rather, the client was thrown out and immediately tried to login again and start over with the folder in question. This repeated itself over and over again. The logs on the server didn't give me too much except that the imapd process exited with code 256. I didn't have the time to delve into this problem so I made a backup of the problematic folder and removed it. Also, if there was something with the folder that caused the imap server to barf badly I would have to find out why myself; I didn't want to give away my private messages to someone else.

Today the problem occurred again, this time with a folder containing mails from a mailing list I'm subscribed to. Good, I thought, now I have a folder that cause the server to barf and which I can give away to someone I don't know. Then I realized what the problem was.

When I installed courier-imap I didn't want to use all the tools surrounding the imap daemon. I wanted the daemon to run under daemontools, as most of my other service daemons are. To make this happen I had to go through courier's startup files and scripts to find out how it worked. Now I faintly remembered that the startup script shipped with courier-imap used Bourne Shell's ulimit to limit the maximum allowed size of the imap daemon. Running the daemon with daemontools I had of course gone with softlimit from the same package.

With ulimit you specify limits in kilo bytes while with softlimit you do it in bytes. The daemon was limited to only 65536 bytes of memory when it, with the default installation, would have been limited to a thousand times more. I changed the limit and my broken folders weren't broken anymore.

2003-03-14

Swedish blog

Ok, so I've set up a swedish blog. Enjoy!

2003-03-13

Justify more

It just hit me that text-align: justify; is a cool thing to use in my style sheet.

Peter stole my idea!

For quite some time I've been thinking of starting a weblog in swedish. I'd keep this one for programming and computer related topics, and concentrate more on life in general on the swedish one. This was my idea anyway, but as I'm a thinker and not a doer, Peter naturally beat me to it (Peter's an excellent thinker and at the same time an outstanding doer). I don't know how long it'll take me to get my thumb out of ...

2003-03-10

What are buffer overflows anyway?

Linux Journal: ``Buffer overflow problems always have been associated with security vulnerabilities. In the past, lots of security breaches have occurred due to buffer overflow. This article attempts to explain what buffer overflow is, how it can be exploited and what countermeasures can be taken to avoid it."

The article can be found here.


Hosted by Oops FREE THE MOUSE
This site is powered by Burger; powered by djbdns; powered by lighttpd; powered by FreeBSD; powered by electricity.