Dovecot/InstallThunderbird

Dovecot
Dovecote is a powerful mail server, capable of functionality far beyond this brief guide. This guide only explores a corner of its abilities. If you need more go to http://wiki2.dovecot.org/FrontPage, ad work from there.

Dovecot as a mail store
Thunderbird seems to be a popular email client in the Gentoo world. One issue which can bite you is that, by default, Thunderbird stores all the emails in a given directory in a single file. As might be expected this file can get huge, and this can slow down many operations. An alternative is to use Dovecot as an IMAP store, storing emails in the maildir format (i.e. one email per file), and running on your Gentoo box.

Dovecot1 vs. Dovecot2
The current release of Dovecot is 2.0.15. Much of the documentation on this wiki, as of November 2011, only covers Dovecot 1. There are major differences in the layout of the configuration files. Dovecot 1 stored everything in a single file. Dovecot 2 stills uses this file, but most of the configuration is done in a set of files in the directory. The files in this directory are automatically included in the configuration. Dovecot configuration files follow the common convention that all configurations are given, commented out with a # character, and separated from their default value by an equals sign. In the files below, lines prefixed with two # characters are my comments, those with only one # are as found in the default Dovecot installation.

Installing Dovecot 2
This is quite straightforward :-

Please check that Dovecot will be built with the following Use flags :-

If either of these is missing then fix it by adding the following to :

Then emerge dovecot as shown

Configuring Dovecot 2
You must check a few settings in {{Path|/etc/dovecot/dovecot.conf)). {{File|/etc/dovecot/dovecot.conf| protocols = imap
 * 1) Protocols we want to be serving.
 * 2) protocols = imap pop3 - we only want imap, so remove pop3

listen = *, :: }}
 * 1) A comma separated list of IPs or hosts where to listen in for connections.
 * 2) "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
 * 3) If you want to specify non-default ports or anything more complex,
 * 4) edit conf.d/master.conf.
 * 5) The default is very likely what you want.

The next settings are in the {{Path|/etc/dovecot/conf.d}} directory.

First, we allow plaintext authentication. In {{Path|/etc/dovecot/conf.d/10-auth.conf}} {{File|/etc/dovecot/dovecot.conf| disable_plaintext_auth = no }}
 * 1) Disable LOGIN command and all other plaintext authentications unless
 * 2) SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
 * 3) matches the local IP (ie. you're connecting from the same computer), the
 * 4) connection is considered secure and plaintext authentication is allowed.
 * 5) disable_plaintext_auth = yes

Then turn off the need for ssl support. {{File|/etc/dovecot/dovecot.conf/10-ssl.conf| ssl = no }}
 * 1) SSL/TLS support: yes, no, required. 
 * 2) ssl = yes Turn off the requirement for ssl

Turn off ldap authentication, leaving only system (i.e. PAM) authentication. {{File|/etc/dovecot/dovecot.conf/10-auth.conf|
 * 1) !include auth-deny.conf.ext
 * 2) !include auth-master.conf.ext

!include auth-system.conf.ext }}
 * 1) leave only the auth-system.conf.ext, i.e. PAM
 * 1) !include auth-sql.conf.ext
 * 2) !include auth-ldap.conf.ext - comment out this line, the others are already commented out
 * 3) !include auth-passwdfile.conf.ext
 * 4) !include auth-checkpassword.conf.ext
 * 5) !include auth-vpopmail.conf.ext
 * 6) !include auth-static.conf.ext

Finally, tell Dovecot where to find your maildir. The choice is entirely up to you, but a common choice is either ~/Maildir or ~/.maildir.

{{File|/etc/dovecot/dovecot.conf/10-mail.conf| [SNIP] mail_location = maildir:/home/%u/.maildir:LAYOUT=fs }}
 * 1) Location for users' mailboxes. The default is empty, which means that Dovecot
 * 2) tries to find the mailboxes automatically. This won't work if the user
 * 3) doesn't yet have any mail, so you should explicitly tell Dovecot the full
 * 4) location.
 * 1) There are a few special variables you can use, eg.:
 * 2)   %u - username
 * 3)   %n - user part in user@domain, same as %u if there's no domain
 * 4)   %d - domain part in user@domain, empty if there's no domain
 * 5)   %h - home directory
 * 6) See doc/wiki/Variables.txt for full list. Some examples:
 * 7)   mail_location = maildir:~/Maildir
 * 8)   mail_location = mbox:~/mail:INBOX=/var/mail/%u
 * 9)   mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n
 * 10) 
 * 11) mail_location = maildir:~/.maildir
 * 12) One, or both, of these two will work. The added ':LAYOUT=fs' is for Thunderbird specifically.
 * 13) mail_location = maildir:~/.maildir:LAYOUT=fs
 * 1) 
 * 2) mail_location = maildir:~/.maildir
 * 3) One, or both, of these two will work. The added ':LAYOUT=fs' is for Thunderbird specifically.
 * 4) mail_location = maildir:~/.maildir:LAYOUT=fs
 * 1) mail_location = maildir:~/.maildir:LAYOUT=fs

Setting up PAM
This only works is you are using PAM already, but this is the Gentoo default, unless you have removed it yourself. This method uses the set of users on your machine, so you will be asked to provide your login username and password. There are lots of other methods of authentication if you prefer, this is just the easiest. You need to create a file

Setting up Thunderbird
You need to create a new account - File -> New -> Account. It's probably simplest to call it Dovecot, but feel free to choose anything you like. The server settings are
 * Servername
 * localhost


 * Port
 * 143


 * Username
 * ""Your"" login name on that PC


 * Connection security
 * None


 * Authentication method
 * Password transmitted insecurely


 * Local directory
 * Whatever you set your maildir to in Dovecot 10-mail.conf - e.g. /home/fred/.maildir

Starting Dovecot
Start Dovecot with

Add Dovecot to the default runlevel with

If it doesn't work try http://wiki2.dovecot.org/FrontPage