Go to Tools | Account Settings. In the resulting "Account Settings" window click "Add Account".
Make sure "Email Account" is selected in the new "Account Wizard" window, and click "Next".
Add your name and your email address (this is the address for delivery to your mailbox on your server, most likely [user]@[domain]) and click "Next".
On the next page select "IMAP" and in the "Incoming Server" field the domain name for your mail server. Click "Next".
The "Incoming User Name" should be your system user name [user]. Click "Next".
Specify an "Account Name". A default value will be completed for you, but it can be anything. Click "Next".
On the final page verify that all the details are correct. Click "Finish", and the "Account Wizard" window will close.
Connecting over IMAP-SSL
By default Thunderbird will be configured to connect using IMAP, not IMAP-SSL. To change this do the following:
In the "Account Settings" window click on "Server Settings" in the left-side pane for the account you have just configured.
Click "SSL" in the "Security Settings" section. You will see the port number change from 143 to 993.
Click "OK" at the bottom.
You should now have a correctly configured account for your mail server.In the main Thunderbird window you will see an entry for your new mail account. Click on "Inbox", and Thunderbird will connect to your mail server. An SSL certificate warning will pop up. This is because the SSL certificate you generated earlier is not signed by a verification agency. However this does not mean that the encryption is any less secure. Getting a certificate verified is an expensive process, and really not necessary. Select "Accept this certificate permanently". You will get another warning message, click "OK". Enter your user password, and hey-presto! With any luck your inbox should open with the test message sent earlier.
Cached connections and IMAP-IDLE
In order to improve performance Thunderbird uses cached connections. By default the number of cached connections is set to five. Courier-imap however allows a maximum of four connections per client (although this can be changed). If accessing several mailboxes on the same server you may get an error stating that the maximum number of connections has been exceeded. In order to fix this change the number of cached connections to one. For each account you have set up:
"Account Settings" | "Server Settings" and click "Advanced".
Change "Maximum number of server connections to cache" to 1.
Uncheck "Use IDLE command if the server supports it"