aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/private/mail/relay.nix15
-rw-r--r--modules/private/mail/sympa.nix10
-rw-r--r--overlays/postfix/default.nix2
3 files changed, 26 insertions, 1 deletions
diff --git a/modules/private/mail/relay.nix b/modules/private/mail/relay.nix
index ae74112..52288fc 100644
--- a/modules/private/mail/relay.nix
+++ b/modules/private/mail/relay.nix
@@ -69,6 +69,19 @@
69 ''; 69 '';
70 } 70 }
71 { 71 {
72 dest = "postfix/sympa_mailbox_maps";
73 user = config.services.postfix.user;
74 group = config.services.postfix.group;
75 permissions = "0440";
76 text = ''
77 hosts = ${config.myEnv.mail.sympa.postgresql.host}
78 user = ${config.myEnv.mail.sympa.postgresql.user}
79 password = ${config.myEnv.mail.sympa.postgresql.password}
80 dbname = ${config.myEnv.mail.sympa.postgresql.database}
81 query = SELECT DISTINCT CONCAT(name_list, '@', robot_list) FROM list_table
82 '';
83 }
84 {
72 dest = "postfix/ldap_ejabberd_users_immae_fr"; 85 dest = "postfix/ldap_ejabberd_users_immae_fr";
73 user = config.services.postfix.user; 86 user = config.services.postfix.user;
74 group = config.services.postfix.group; 87 group = config.services.postfix.group;
@@ -95,6 +108,7 @@
95 paths = [ 108 paths = [
96 config.secrets.fullPaths."postfix/mysql_alias_maps" 109 config.secrets.fullPaths."postfix/mysql_alias_maps"
97 config.secrets.fullPaths."postfix/mysql_mailbox_maps" 110 config.secrets.fullPaths."postfix/mysql_mailbox_maps"
111 config.secrets.fullPaths."postfix/sympa_mailbox_maps"
98 config.secrets.fullPaths."postfix/ldap_ejabberd_users_immae_fr" 112 config.secrets.fullPaths."postfix/ldap_ejabberd_users_immae_fr"
99 ]; 113 ];
100 }; 114 };
@@ -182,6 +196,7 @@
182 virtual_mailbox_maps = [ 196 virtual_mailbox_maps = [
183 "hash:/etc/postfix/host_dummy_mailboxes" 197 "hash:/etc/postfix/host_dummy_mailboxes"
184 "mysql:${config.secrets.fullPaths."postfix/mysql_mailbox_maps"}" 198 "mysql:${config.secrets.fullPaths."postfix/mysql_mailbox_maps"}"
199 "pgsql:${config.secrets.fullPaths."postfix/sympa_mailbox_maps"}"
185 ]; 200 ];
186 in 201 in
187 backup_recipients ++ virtual_alias_maps ++ virtual_mailbox_maps; 202 backup_recipients ++ virtual_alias_maps ++ virtual_mailbox_maps;
diff --git a/modules/private/mail/sympa.nix b/modules/private/mail/sympa.nix
index ed7e598..1a696d0 100644
--- a/modules/private/mail/sympa.nix
+++ b/modules/private/mail/sympa.nix
@@ -5,6 +5,16 @@ let
5in 5in
6{ 6{
7 config = lib.mkIf config.myServices.mail.enable { 7 config = lib.mkIf config.myServices.mail.enable {
8 myServices.databases.postgresql.authorizedHosts = {
9 backup-2 = [
10 {
11 username = "sympa";
12 database = "sympa";
13 ip4 = [config.myEnv.servers.backup-2.ips.main.ip4];
14 ip6 = config.myEnv.servers.backup-2.ips.main.ip6;
15 }
16 ];
17 };
8 services.duplyBackup.profiles.sympa = { 18 services.duplyBackup.profiles.sympa = {
9 rootDir = "/var/lib/sympa"; 19 rootDir = "/var/lib/sympa";
10 }; 20 };
diff --git a/overlays/postfix/default.nix b/overlays/postfix/default.nix
index 55b8312..c77e4cf 100644
--- a/overlays/postfix/default.nix
+++ b/overlays/postfix/default.nix
@@ -1,3 +1,3 @@
1self: super: { 1self: super: {
2 postfix = super.postfix.override { withMySQL = true; }; 2 postfix = super.postfix.override { withMySQL = true; withPgSQL = true; };
3} 3}