This documentation is for Dovecot v1.x, see wiki2 for v2.x documentation.
Differences between revisions 1 and 2
Revision 1 as of 2004-09-29 18:54:22
Size: 5845
Editor: ip213-185-36-189
Comment:
Revision 2 as of 2005-05-21 16:52:35
Size: 5918
Editor: 194-78-168-253
Comment: Fixed similiar (should be similar) and added some articles here and there.
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
That installs Dovecot under `/usr/local` directory. That installs Dovecot under the `/usr/local` directory.
Line 13: Line 13:
If you have installed some libraries into locations which require special include or library paths, you can give them in `CPPFLAGS` and `LDFLAGS` environment variables. For example: If you have installed some libraries into locations which require special include or library paths, you can give them in the `CPPFLAGS` and `LDFLAGS` environment variables. For example:
Line 21: Line 21:
If you got Dovecot from CVS, you'll first need to run `./autogen.sh` to generate `configure` script. This also requires that you have `pkg-config` package installed (`/usr/share/aclocal/pkg.m4` file is needed). If you got Dovecot from CVS, you'll first need to run `./autogen.sh` to generate the `configure` script. This also requires that you have the `pkg-config` package installed (`/usr/share/aclocal/pkg.m4` file is needed).
Line 27: Line 27:
OpenSSL is used by default now, and it should be automatically detected. If it's not, you're missing some header files or libraries, or they're just in nonstandard path. Make sure you have `openssl-dev` or similiar package installed, and if it's not in standard location set `CPPFLAGS` and `LDFLAGS` as shown in the first section above. OpenSSL is used by default now, and it should be automatically detected. If it's not, you're missing some header files or libraries, or they're just in a nonstandard path. Make sure you have the `openssl-dev` or a similar package installed, and if it's not in the standard location set `CPPFLAGS` and `LDFLAGS` as shown in the first section above.
Line 29: Line 29:
By default SSL certificate is read from `/etc/ssl/certs/dovecot.pem` and private key from `/etc/ssl/private/dovecot.pem`. The `/etc/ssl` directory can be changed using `--with-ssldir=DIR` configure option. Both can of course be overridden from configuration file. By default the SSL certificate is read from `/etc/ssl/certs/dovecot.pem` and the private key from `/etc/ssl/private/dovecot.pem`. The `/etc/ssl` directory can be changed using `--with-ssldir=DIR` configure option. Both can of course be overridden from the configuration file.
Line 39: Line 39:
`--enable-ipv6` Enable IPv6 support. Enabled by default if system is detected to support it. `--enable-ipv6` Enable IPv6 support. This is enabled by default if the system is detected to support it.
Line 45: Line 45:
`--with-file-offset-size=BITS` Specifies if we use 32bit or 64bit file offsets. 64bit is the default if system supports it (Linux and Solaris does). Dropping this to 32bit may save some memory, but it prevents accessing any file larger than 2GB. `--with-file-offset-size=BITS` Specifies if we use 32bit or 64bit file offsets. 64bit is the default if the system supports it (Linux and Solaris do). Dropping this to 32bit may save some memory, but it prevents accessing any file larger than 2GB.
Line 47: Line 47:
`--with-mem-align=BYTES` Specifies memory alignment used for memory allocations. It's needed with many non-x86 systems and doing it should speed up x86 systems too. Default is 8 to make sure 64bit memory accessing work. `--with-mem-align=BYTES` Specifies memory alignment used for memory allocations. It's needed with many non-x86 systems and doing it should speed up x86 systems too. Default is 8 to make sure 64bit memory accessing works.
Line 51: Line 51:
`--with-pop3d` Build POP3 server binary as well as IMAP server (default). It still has to be separately enabled from configuration file before it's actually used. `--with-pop3d` Build POP3 server binary as well as IMAP server (default). It still has to be separately enabled from the configuration file before it's actually used.
Line 80: Line 80:
Dovecot can also dynamically load authentication modules from $prefix/lib/dovecot/auth/ directory. Binary packages builders should use them for authentication modules which require external libraries (eg. LDAP and vpopmail). There's no standard way to build them as modules currently, but something like this should work: Dovecot can also dynamically load authentication modules from the $prefix/lib/dovecot/auth/ directory. Binary packages builders should use them for authentication modules which require external libraries (eg. LDAP and vpopmail). There's no standard way to build them as modules currently, but something like this should work:
Line 102: Line 102:
If `imap_use_modules` or `pop3_use_modules` is set to yes, Dovecot will load all `*.so` modules from directory pointed by `mail_modules` setting. These modules can do anything, they're only expected to contain `<module name>_init` and `<module name>_deinit` functions which are called. If `imap_use_modules` or `pop3_use_modules` is set to yes, Dovecot will load all `*.so` modules from the directory pointed to by the `mail_modules` setting. These modules can do anything, they're only expected to contain `<module name>_init` and `<module name>_deinit` functions which are called.

Compiling Dovecot From Sources

For most people it's enough to do:

./configure
make
sudo make install

That installs Dovecot under the /usr/local directory.

If you have installed some libraries into locations which require special include or library paths, you can give them in the CPPFLAGS and LDFLAGS environment variables. For example:

  CPPFLAGS=-I/opt/openssl/include LDFLAGS=-L/opt/openssl/lib ./configure

CVS

If you got Dovecot from CVS, you'll first need to run ./autogen.sh to generate the configure script. This also requires that you have the pkg-config package installed (/usr/share/aclocal/pkg.m4 file is needed).

SSL/TLS Support

Dovecot initially was built to support both OpenSSL and GNUTLS. GNUTLS however had some problems and nowadays it doesn't work anymore. Patches to fix it are welcome.

OpenSSL is used by default now, and it should be automatically detected. If it's not, you're missing some header files or libraries, or they're just in a nonstandard path. Make sure you have the openssl-dev or a similar package installed, and if it's not in the standard location set CPPFLAGS and LDFLAGS as shown in the first section above.

By default the SSL certificate is read from /etc/ssl/certs/dovecot.pem and the private key from /etc/ssl/private/dovecot.pem. The /etc/ssl directory can be changed using --with-ssldir=DIR configure option. Both can of course be overridden from the configuration file.

Optional Configure Options

--help gives a full list of available options.

Options are usually listed as --with-something or --enable-something. If you want to disable them, do it as --without-something or --disable-something. There are many default options that come from autoconf, automake or libtool. They are explained elsewhere.

Here's a list of options that Dovecot adds. You shouldn't usually have to change these, but they're described here just for completeness:

--enable-ipv6 Enable IPv6 support. This is enabled by default if the system is detected to support it.

--enable-debug Enables some extra checks for debugging. This is mostly useful for developers. It does quite a lot of unnecessary work but should catch some programming mistakes more quickly.

--enable-asserts Enable assertion checks, enabled by default. Disabling them may slightly save some CPU, but if there are bugs they can cause more problems since they aren't detected as early.

--with-file-offset-size=BITS Specifies if we use 32bit or 64bit file offsets. 64bit is the default if the system supports it (Linux and Solaris do). Dropping this to 32bit may save some memory, but it prevents accessing any file larger than 2GB.

--with-mem-align=BYTES Specifies memory alignment used for memory allocations. It's needed with many non-x86 systems and doing it should speed up x86 systems too. Default is 8 to make sure 64bit memory accessing works.

--with-ioloop=IOLOOP Specifies what I/O loop method to use. Possibilities are select, poll and epoll. Default is to use poll if possible and fallback to select. epoll is faster than either of them, but it works only only on Linux 2.6 kernels.

--with-pop3d Build POP3 server binary as well as IMAP server (default). It still has to be separately enabled from the configuration file before it's actually used.

--with-storages=FORMATS Specifies what mailbox formats to support. Default is maildir,mbox.

Authentication Backend Options

The basic backends are built if the system is detected to support them:

  --with-passwd           Build with /etc/passwd support (default)
  --with-passwd-file      Build with passwd-like file support (default)
  --with-shadow           Build with shadow password support (default)
  --with-pam              Build with PAM support (default)
  --with-checkpassword    Build with checkpassword support (default)
  --with-bsdauth          Build with BSD authentication support (default)
  --with-static-userdb    Build with static userdb support (default)
  --with-vpopmail         Build with vpopmail support (default)

Some backends require extra libraries and aren't necessarily wanted, so they're built only if specifically enabled:

  --with-ldap             Build with LDAP support
  --with-pgsql            Build with PostgreSQL support
  --with-mysql            Build with MySQL support

Dynamic Authentication Modules

Dovecot can also dynamically load authentication modules from the $prefix/lib/dovecot/auth/ directory. Binary packages builders should use them for authentication modules which require external libraries (eg. LDAP and vpopmail). There's no standard way to build them as modules currently, but something like this should work:

gcc -shared -fPIC -DHAVE_CONFIG_H -DUSERDB_LDAP -DPASSDB_LDAP \
-I../.. -I../lib -I../lib-settings \
db-ldap.c userdb-ldap.c passdb-ldap.c -o ldap.so \
../lib-settings/libsettings.a -lldap

gcc -shared -fPIC -DHAVE_CONFIG_H -DUSERDB_PGSQL -DPASSDB_PGSQL \
-I../.. -I../lib -I../lib-settings -I/usr/include/postgresql \
db-pgsql.c userdb-pgsql.c passdb-pgsql.c -o pgsql.so \
../lib-settings/libsettings.a -L/usr/lib/postgresql -lpq

gcc -shared -fPIC -DHAVE_CONFIG_H -DUSERDB_VPOPMAIL -DPASSDB_VPOPMAIL \
-I../.. -I../lib userdb-vpopmail.c passdb-vpopmail.c -o vpopmail.so \
-lvpopmail

Including libsettings.a in ldap.so and pgsql.so is kind of annoying, but it's not needed elsewhere in dovecot-auth.

Dynamic IMAP and POP3 Modules

If imap_use_modules or pop3_use_modules is set to yes, Dovecot will load all *.so modules from the directory pointed to by the mail_modules setting. These modules can do anything, they're only expected to contain <module name>_init and <module name>_deinit functions which are called.

None: CompilingSource (last edited 2009-12-07 17:19:38 by p5B105044)