Fuck it, switch to Xapian
This commit is contained in:
parent
20beaa5a0d
commit
4550aade49
40
dovecot.nix
40
dovecot.nix
|
@ -217,9 +217,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# FIXME: TEMPORARY FOR TESTING
|
|
||||||
environment.systemPackages = with pkgs; [ openldap ];
|
|
||||||
|
|
||||||
systemd = {
|
systemd = {
|
||||||
tmpfiles.rules = [
|
tmpfiles.rules = [
|
||||||
"d ${cfg.state-directory} 0711 root root - -"
|
"d ${cfg.state-directory} 0711 root root - -"
|
||||||
|
@ -252,7 +249,7 @@ in {
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.curl}/bin/curl http://${cfg.solr.host}:${
|
ExecStart = "${pkgs.curl}/bin/curl http://${cfg.solr.host}:${
|
||||||
toString cfg.solr.port
|
toString cfg.solr.port
|
||||||
}/?${params}";
|
}/solr/dovecot/update?${params}";
|
||||||
PrivateDevices = true;
|
PrivateDevices = true;
|
||||||
PrivateTmp = true;
|
PrivateTmp = true;
|
||||||
PrivateMounts = true;
|
PrivateMounts = true;
|
||||||
|
@ -351,10 +348,16 @@ in {
|
||||||
|
|
||||||
mailboxes = cfg.mailboxes;
|
mailboxes = cfg.mailboxes;
|
||||||
|
|
||||||
modules = with pkgs; [ dovecot_pigeonhole ];
|
modules = with pkgs; [ dovecot_pigeonhole dovecot_fts_xapian ];
|
||||||
protocols = [ "sieve" ];
|
protocols = [ "sieve" ];
|
||||||
|
|
||||||
mailPlugins.globally.enable = [ "old_stats" "fts" "fts_solr" ];
|
mailPlugins = {
|
||||||
|
globally.enable = [ "old_stats" "fts" "fts_xapian" ];
|
||||||
|
perProtocol = {
|
||||||
|
imap = [ "imap_sieve" "fts" "fts_xapian" ];
|
||||||
|
lmtp = [ "sieve" "fts" "fts_xapian" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
sieveScripts = {
|
sieveScripts = {
|
||||||
after = builtins.toFile "spam.sieve" ''
|
after = builtins.toFile "spam.sieve" ''
|
||||||
|
@ -398,25 +401,18 @@ in {
|
||||||
verbose_ssl = yes
|
verbose_ssl = yes
|
||||||
''}
|
''}
|
||||||
|
|
||||||
protocol imap {
|
|
||||||
mail_max_userip_connections = ${toString cfg.max-user-connections}
|
|
||||||
mail_plugins = $mail_plugins imap_sieve fts fts_solr
|
|
||||||
}
|
|
||||||
|
|
||||||
protocol lmtp {
|
|
||||||
mail_plugins = $mail_plugins sieve fts fts_solr
|
|
||||||
}
|
|
||||||
|
|
||||||
plugin {
|
plugin {
|
||||||
fts = solr
|
fts = xapian
|
||||||
fts_solr = url=http://${cfg.solr.host}:${
|
fts_xapian = partial=3 full=20 ${optionalString cfg.debug "verbose"}
|
||||||
toString cfg.solr.port
|
|
||||||
}/solr/dovecot ${optionalString cfg.debug "debug"}
|
|
||||||
fts_autoindex = yes
|
fts_autoindex = yes
|
||||||
fts_autoindex_exclude = \Junk
|
|
||||||
fts_autoindex_exclude = \Trash
|
|
||||||
fts_decoder = decode2text
|
|
||||||
fts_enforced = yes
|
fts_enforced = yes
|
||||||
|
fts_autoindex_exclude = \Trash
|
||||||
|
fts_autoindex_exclude = \Junk
|
||||||
|
fts_decoder = decode2text
|
||||||
|
}
|
||||||
|
|
||||||
|
service indexer-worker {
|
||||||
|
vsz_limit = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
mail_access_groups = ${cfg.mail-group}
|
mail_access_groups = ${cfg.mail-group}
|
||||||
|
|
|
@ -434,9 +434,8 @@ in {
|
||||||
image = cfg.images.solr;
|
image = cfg.images.solr;
|
||||||
restart = "always";
|
restart = "always";
|
||||||
networks = [ "solr_network" ];
|
networks = [ "solr_network" ];
|
||||||
volumes =
|
volumes = [ "${cfg.state-directory}/solr:/var/solr" ];
|
||||||
[ "${cfg.state-directory}/solr:/opt/solr/server/solr/dovecot" ];
|
#user = "${toString config.users.users.mail-server-solr.uid}:8983";
|
||||||
user = "${toString config.users.users.mail-server-solr.uid}:8983";
|
|
||||||
};
|
};
|
||||||
antispam = {
|
antispam = {
|
||||||
service = {
|
service = {
|
||||||
|
|
Loading…
Reference in New Issue