Merge branch 'plchldr/nixos-mailserver-master'

This commit is contained in:
Robin Raymond 2018-11-10 14:09:26 +01:00
commit 28cff2497a
6 changed files with 1 additions and 34 deletions

View file

@ -405,17 +405,6 @@ in
'';
};
dhParamBitLength = mkOption {
type = types.int;
default = 2048;
description =
''
Length of the Diffie Hillman prime used (in bits). It might be a good
idea to set this to 4096 for security purposed, but it will take a _very_
long time to create this prime on startup.
'';
};
debug = mkOption {
type = types.bool;
default = false;

View file

@ -97,9 +97,6 @@ in
mail_access_groups = ${vmailGroupName}
ssl = required
${lib.optionalString (lib.versionAtLeast (lib.getVersion pkgs.dovecot) "2.3") ''
ssl_dh = <${certificateDirectory}/dh.pem
''}
service lmtp {
unix_listener dovecot-lmtp {

View file

@ -18,20 +18,6 @@
let
cfg = config.mailserver;
createDhParameterFile =
lib.optionalString (lib.versionAtLeast (lib.getVersion pkgs.dovecot) "2.3")
''
# Create a dh parameter file
if [ ! -s "${cfg.certificateDirectory}/dh.pem" ]
then
mkdir -p "${cfg.certificateDirectory}"
${pkgs.openssl}/bin/openssl \
dhparam ${builtins.toString cfg.dhParamBitLength} \
> "${cfg.certificateDirectory}/dh.pem"
fi
'';
preliminarySelfsigned = config.security.acme.preliminarySelfsigned;
acmeWantsTarget = [ "acme-certificates.target" ]
++ (lib.optional preliminarySelfsigned "acme-selfsigned-certificates.target");
@ -74,7 +60,7 @@ in
};
};
# Create maildir folder and dh parameters before dovecot startup
# Create maildir folder before dovecot startup
systemd.services.dovecot2 = {
after = [ "mailserver-certificates.target" ];
wants = [ "mailserver-certificates.target" ];
@ -84,8 +70,6 @@ in
mkdir -p "${mailDirectory}"
chgrp "${vmailGroupName}" "${mailDirectory}"
chmod 02770 "${mailDirectory}"
${createDhParameterFile}
'';
};

View file

@ -71,7 +71,6 @@ import <nixpkgs/nixos/tests/make-test.nix> {
debug = true;
fqdn = "mail.example.com";
domains = [ "example.com" "example2.com" ];
dhParamBitLength = 512;
virusScanning = true;
loginAccounts = {

View file

@ -36,7 +36,6 @@ import <nixpkgs/nixos/tests/make-test.nix> {
debug = true;
fqdn = "mail.example.com";
domains = [ "example.com" "example2.com" ];
dhParamBitLength = 512;
rewriteMessageId = true;
loginAccounts = {

View file

@ -27,7 +27,6 @@ import <nixpkgs/nixos/tests/make-test.nix> {
enable = true;
fqdn = "mail.example.com";
domains = [ "example.com" ];
dhParamBitLength = 512;
loginAccounts = {
"user1@example.com" = {