diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-05-06 00:18:28 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-05-06 00:18:28 +0200 |
commit | 4e07970c88f474bc45ae3e723c62df5f6711833e (patch) | |
tree | 638ddadb1cd5d86511cbe0dd096a7954195e00a3 /modules/private | |
parent | 91b3d06b6a9147e0e03b49d25cdcecb8a617a4f7 (diff) | |
download | Nix-4e07970c88f474bc45ae3e723c62df5f6711833e.tar.gz Nix-4e07970c88f474bc45ae3e723c62df5f6711833e.tar.zst Nix-4e07970c88f474bc45ae3e723c62df5f6711833e.zip |
Add sympa mailing lists to MX backup
Diffstat (limited to 'modules/private')
-rw-r--r-- | modules/private/mail/relay.nix | 15 | ||||
-rw-r--r-- | modules/private/mail/sympa.nix | 10 |
2 files changed, 25 insertions, 0 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 | |||
5 | in | 5 | in |
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 | }; |