Parcourir la source

Adding bits for configuring mail aliases, and a postmaster@ address as an example

sjahl il y a 11 ans
Parent
révision
a4bcb48199

+ 7
- 0
roles/mailserver/templates/mailserver.sql.j2 Voir le fichier

@@ -38,3 +38,10 @@ INSERT INTO {{ mail_mysql_database }}.`virtual_domains` (`id`, `name`)
38 38
 INSERT INTO {{ mail_mysql_database }}.`virtual_users`  (`domain_id`, `password` , `email`)
39 39
 	VALUES ('{{ virtual_user.domain_pk_id }}', '{{ virtual_user.password_hash }}', '{{ virtual_user.address }}');
40 40
 {% endfor %}
41
+
42
+{% if mail_virtual_aliases is defined %}
43
+{% for virtual_alias in mail_virtual_aliases %}
44
+INSERT INTO {{ mail_mysql_database }}.`virtual_aliases` (`domain_id`, `source`, `destination`)
45
+    VALUES ('{{ virtual_alias.domain_pk_id }}', '{{ virtual_alias.source }}', '{{virtual_alias.destination }}');
46
+{% endfor %}
47
+{% endif %}

+ 4
- 0
roles/mailserver/vars/main.yml Voir le fichier

@@ -17,3 +17,7 @@ mail_virtual_users:
17 17
   - address: TODO@TODO.com
18 18
     password_hash: TODO@TODO.com
19 19
     domain_pk_id: 2
20
+mail_virtual_aliases:
21
+  - source: postmaster@TODO.com
22
+    destination: TODO@TODO.com
23
+    domain_pk_id: 1

Chargement…
Annuler
Enregistrer