dovecot: Add version 2.2.4 as attribute dovecot22

I also added a patch that makes dovecot search for
plugins in /var/lib/dovecot/modules. This way, you
can add plugins from several packages without running
into circular dependencies. The module dir needs to
be populated before the dovecot service is started,
for example. This is currently not done in NixOS, so
you need to implement your own service in order to
get the plugins working.

The module patch has not been added to the old 2.1.x
package.
This commit is contained in:
Rickard Nilsson 2013-07-15 14:48:34 +02:00
parent 46a2dfe960
commit 93ff42ae9c
3 changed files with 160 additions and 1 deletions

View File

@ -0,0 +1,114 @@
diff -ur dovecot-2.2.2-orig/src/auth/main.c dovecot-2.2.2/src/auth/main.c
--- dovecot-2.2.2-orig/src/auth/main.c 2013-03-13 15:26:46.000000000 +0100
+++ dovecot-2.2.2/src/auth/main.c 2013-05-20 20:23:58.126024535 +0200
@@ -193,7 +193,7 @@
mod_set.debug = global_auth_settings->debug;
mod_set.filter_callback = auth_module_filter;
- modules = module_dir_load(AUTH_MODULE_DIR, NULL, &mod_set);
+ modules = module_dir_load("/var/lib/dovecot/modules/auth", NULL, &mod_set);
module_dir_init(modules);
if (!worker)
@@ -223,7 +223,7 @@
mod_set.debug = global_auth_settings->debug;
mod_set.ignore_missing = TRUE;
- modules = module_dir_load_missing(modules, AUTH_MODULE_DIR, names,
+ modules = module_dir_load_missing(modules, "/var/lib/dovecot/modules/auth", names,
&mod_set);
module_dir_init(modules);
}
diff -ur dovecot-2.2.2-orig/src/config/all-settings.c dovecot-2.2.2/src/config/all-settings.c
--- dovecot-2.2.2-orig/src/config/all-settings.c 2013-05-15 12:20:55.000000000 +0200
+++ dovecot-2.2.2/src/config/all-settings.c 2013-05-21 00:31:46.624073562 +0200
@@ -766,7 +766,7 @@
.last_valid_gid = 0,
.mail_plugins = "",
- .mail_plugin_dir = MODULEDIR,
+ .mail_plugin_dir = "/var/lib/dovecot/modules",
.mail_log_prefix = "%s(%u): ",
@@ -3274,7 +3274,7 @@
.base_dir = PKG_RUNDIR,
.libexec_dir = PKG_LIBEXECDIR,
.mail_plugins = "",
- .mail_plugin_dir = MODULEDIR,
+ .mail_plugin_dir = "/var/lib/dovecot/modules",
.doveadm_socket_path = "doveadm-server",
.doveadm_worker_count = 0,
.doveadm_port = 0,
diff -ur dovecot-2.2.2-orig/src/config/config-parser.c dovecot-2.2.2/src/config/config-parser.c
--- dovecot-2.2.2-orig/src/config/config-parser.c 2013-02-04 22:05:42.000000000 +0100
+++ dovecot-2.2.2/src/config/config-parser.c 2013-05-20 20:23:58.106024534 +0200
@@ -990,7 +990,7 @@
memset(&mod_set, 0, sizeof(mod_set));
mod_set.abi_version = DOVECOT_ABI_VERSION;
- modules = module_dir_load(CONFIG_MODULE_DIR, NULL, &mod_set);
+ modules = module_dir_load("/var/lib/dovecot/modules/settings", NULL, &mod_set);
module_dir_init(modules);
i_array_init(&new_roots, 64);
diff -ur dovecot-2.2.2-orig/src/dict/main.c dovecot-2.2.2/src/dict/main.c
--- dovecot-2.2.2-orig/src/dict/main.c 2013-02-04 22:05:42.000000000 +0100
+++ dovecot-2.2.2/src/dict/main.c 2013-05-20 20:23:58.101024534 +0200
@@ -61,7 +61,7 @@
mod_set.abi_version = DOVECOT_ABI_VERSION;
mod_set.require_init_funcs = TRUE;
- modules = module_dir_load(DICT_MODULE_DIR, NULL, &mod_set);
+ modules = module_dir_load("/var/lib/dovecot/modules/dict", NULL, &mod_set);
module_dir_init(modules);
/* Register only after loading modules. They may contain SQL drivers,
diff -ur dovecot-2.2.2-orig/src/doveadm/doveadm-settings.c dovecot-2.2.2/src/doveadm/doveadm-settings.c
--- dovecot-2.2.2-orig/src/doveadm/doveadm-settings.c 2013-04-07 19:13:06.000000000 +0200
+++ dovecot-2.2.2/src/doveadm/doveadm-settings.c 2013-05-20 20:23:58.399024539 +0200
@@ -76,7 +76,7 @@
.base_dir = PKG_RUNDIR,
.libexec_dir = PKG_LIBEXECDIR,
.mail_plugins = "",
- .mail_plugin_dir = MODULEDIR,
+ .mail_plugin_dir = "/var/lib/dovecot/modules",
.doveadm_socket_path = "doveadm-server",
.doveadm_worker_count = 0,
.doveadm_port = 0,
diff -ur dovecot-2.2.2-orig/src/lib-fs/fs-api.c dovecot-2.2.2/src/lib-fs/fs-api.c
--- dovecot-2.2.2-orig/src/lib-fs/fs-api.c 2013-04-18 16:07:26.000000000 +0200
+++ dovecot-2.2.2/src/lib-fs/fs-api.c 2013-05-20 20:23:58.099024534 +0200
@@ -82,7 +82,7 @@
mod_set.abi_version = DOVECOT_ABI_VERSION;
mod_set.ignore_missing = TRUE;
- fs_modules = module_dir_load_missing(fs_modules, MODULE_DIR,
+ fs_modules = module_dir_load_missing(fs_modules, "/var/lib/dovecot/modules",
module_name, &mod_set);
module_dir_init(fs_modules);
diff -ur dovecot-2.2.2-orig/src/lib-ssl-iostream/iostream-ssl.c dovecot-2.2.2/src/lib-ssl-iostream/iostream-ssl.c
--- dovecot-2.2.2-orig/src/lib-ssl-iostream/iostream-ssl.c 2013-04-09 22:45:19.000000000 +0200
+++ dovecot-2.2.2/src/lib-ssl-iostream/iostream-ssl.c 2013-05-20 20:23:58.089024534 +0200
@@ -28,7 +28,7 @@
memset(&mod_set, 0, sizeof(mod_set));
mod_set.abi_version = DOVECOT_ABI_VERSION;
mod_set.setting_name = "<built-in lib-ssl-iostream lookup>";
- ssl_module = module_dir_load(MODULE_DIR, plugin_name, &mod_set);
+ ssl_module = module_dir_load("/var/lib/dovecot/modules", plugin_name, &mod_set);
ssl_vfuncs = module_get_symbol(ssl_module, "ssl_vfuncs");
if (ssl_vfuncs == NULL) {
diff -ur dovecot-2.2.2-orig/src/lib-storage/mail-storage-settings.c dovecot-2.2.2/src/lib-storage/mail-storage-settings.c
--- dovecot-2.2.2-orig/src/lib-storage/mail-storage-settings.c 2013-05-15 12:20:00.000000000 +0200
+++ dovecot-2.2.2/src/lib-storage/mail-storage-settings.c 2013-05-20 20:23:57.858024531 +0200
@@ -260,7 +260,7 @@
.last_valid_gid = 0,
.mail_plugins = "",
- .mail_plugin_dir = MODULEDIR,
+ .mail_plugin_dir = "/var/lib/dovecot/modules",
.mail_log_prefix = "%s(%u): ",

View File

@ -0,0 +1,41 @@
{ stdenv, fetchurl, perl, systemd, openssl, pam, bzip2, zlib, openldap
, inotifyTools }:
stdenv.mkDerivation rec {
name = "dovecot-2.2.4";
buildInputs = [perl systemd openssl pam bzip2 zlib openldap inotifyTools];
src = fetchurl {
url = "http://dovecot.org/releases/2.2/${name}.tar.gz";
sha256 = "1i5x7l03q854h4j210cpzair4vak95saccp9gb5p4xx7ndggm3q1";
};
preConfigure = ''
substituteInPlace src/config/settings-get.pl --replace \
"/usr/bin/env perl" "${perl}/bin/perl"
'';
patches = [
# Make dovecot look for plugins in /var/lib/dovecot/modules
# so we can symlink plugins from several packages there
# The symlinking needs to be done in NixOS, as part of the
# dovecot service start-up
./2.2.x-module_dir.patch
];
configureFlags = [
# It will hardcode this for /var/lib/dovecot.
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626211
"--localstatedir=/var"
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
"--with-ldap"
];
meta = {
homepage = "http://dovecot.org/";
description = "Open source IMAP and POP3 email server written with security primarily in mind";
maintainers = with stdenv.lib.maintainers; [viric simons rickynils];
platforms = with stdenv.lib.platforms; linux;
};
}

View File

@ -5857,7 +5857,11 @@ let
dictdWordnet = callPackage ../servers/dict/dictd-wordnet.nix {}; dictdWordnet = callPackage ../servers/dict/dictd-wordnet.nix {};
dovecot = callPackage ../servers/mail/dovecot { }; dovecot = dovecot21;
dovecot21 = callPackage ../servers/mail/dovecot { };
dovecot22 = callPackage ../servers/mail/dovecot/2.2.x.nix { };
ejabberd = callPackage ../servers/xmpp/ejabberd { }; ejabberd = callPackage ../servers/xmpp/ejabberd { };