28 lines
773 B
Nix
28 lines
773 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
mail_config = config.services.mailserver;
|
|
in {
|
|
config = lib.mkIf (mail_config.enable && mail_config.enable_roundcube) {
|
|
services.roundcube = {
|
|
enable = true;
|
|
hostName = "${mail_config.roundcube_url}";
|
|
extraConfig = ''
|
|
$config['smtp_server'] = "tls://${mail_config.fqdn}";
|
|
$config['smtp_user'] = "%u";
|
|
$config['smtp_pass'] = "%p";
|
|
$config['plugins'] = ["managesieve"];
|
|
$config['managesieve_host'] = 'tls://${mail_config.fqdn}';
|
|
${mail_config.extra_roundcube_config}
|
|
'';
|
|
};
|
|
|
|
services.nginx.virtualHosts."${mail_config.roundcube_url}" = {
|
|
forceSSL = mail_config.force_roundcube_ssl;
|
|
enableACME = mail_config.force_roundcube_acme;
|
|
};
|
|
};
|
|
}
|