Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 11cd568e authored by Arthur BOUDREAULT's avatar Arthur BOUDREAULT
Browse files

refactor(yunohost): Apply suggestions to smtp relay feat code

parent f479aba2
No related branches found
No related tags found
1 merge request!14✅Resolve "add smtp relay"
Pipeline #2930 passed with warnings
...@@ -49,18 +49,18 @@ ynh_ignore_dyndns_server: False ...@@ -49,18 +49,18 @@ ynh_ignore_dyndns_server: False
- `ynh_extra_domains` sont des sous-domaines optionnels. Ils permettent d'installer une application par sous-domaine (plus d'infos [ici](https://yunohost.org/fr/dns_subdomains)). - `ynh_extra_domains` sont des sous-domaines optionnels. Ils permettent d'installer une application par sous-domaine (plus d'infos [ici](https://yunohost.org/fr/dns_subdomains)).
- `ynh_ignore_dyndns_server` permet d'enregistrer les domaines avec un service de DNS dynamique (plus d'infos [ici](https://yunohost.org/fr/dns_dynamicip)). - `ynh_ignore_dyndns_server` permet d'enregistrer les domaines avec un service de DNS dynamique (plus d'infos [ici](https://yunohost.org/fr/dns_dynamicip)).
### Configuration d'un relai SMTP ### Configuration d'un relais SMTP
```yml ```yml
# paramètres personnalisés du SMTP relai (A ne modifier qu'en cas de besoin) # paramètres personnalisés du relais SMTP
ynh_new_smtp_relay: ynh_smtp_relay:
host: smtp.domain.tld host: smtp.domain.tld
port: 25 port: 25
user: user1 user: user1
password: Pa$$w0rd password: Pa$$w0rd
``` ```
Yunohost possède son propre serveur SMTP natif mais il est aussi possible de configurer Yunohost pour qu'il utilise un relai SMTP à la place. Yunohost possède son propre serveur SMTP natif mais il est aussi possible de configurer Yunohost pour qu'il utilise un relais SMTP à la place.
Pour faire cela, Décommentez les variables par défaut et mettez vos propres valeurs. Vous pouvez en apprendre plus sur les relais SMTP [ici](https://yunohost.org/fr/administrate/specific_use_cases/email_relay). Pour faire cela, créez la variable `ynh_smtp_relay` et mettez vos propres valeurs. Vous pouvez en apprendre plus sur les relais SMTP [ici](https://yunohost.org/fr/administrate/specific_use_cases/email_relay).
### Gestion des utilisateurs ### Gestion des utilisateurs
......
...@@ -52,8 +52,8 @@ ynh_ignore_dyndns_server: False ...@@ -52,8 +52,8 @@ ynh_ignore_dyndns_server: False
### SMTP relay configuration ### SMTP relay configuration
```yml ```yml
# SMTP custom settings (Only override if you need a SMTP relay) # SMTP custom settings
ynh_new_smtp_relay: ynh_smtp_relay:
host: smtp.domain.tld host: smtp.domain.tld
port: 25 port: 25
user: user1 user: user1
...@@ -61,7 +61,7 @@ ynh_new_smtp_relay: ...@@ -61,7 +61,7 @@ ynh_new_smtp_relay:
``` ```
There is a built-in SMTP server on Yunohost but you can also set up Yunohost to use a SMTP relay instead. There is a built-in SMTP server on Yunohost but you can also set up Yunohost to use a SMTP relay instead.
Uncomment the default variables and provide your own values. You can learn more about SMTP relay [here](https://yunohost.org/en/administrate/specific_use_cases/email_relay). In order to do so, create the `ynh_smtp_relay` variable and provide your own values. You can learn more about SMTP relay [here](https://yunohost.org/en/administrate/specific_use_cases/email_relay).
### User management ### User management
......
...@@ -36,11 +36,16 @@ ynh_users: null ...@@ -36,11 +36,16 @@ ynh_users: null
# lastname: Doe # lastname: Doe
# mail_domain: domain.tld # mail_domain: domain.tld
# Do not touch this variable
# Just to have dict default value
ynh_smtp_relay:
value: null
# SMTP custom settings (Only override if you need a SMTP relay) # SMTP custom settings (Only override if you need a SMTP relay)
ynh_new_smtp_relay: # Example:
value: null # Do you touch this variable # ynh_smtp_relay:
# host: smtp.domain.tld # host: smtp.domain.tld
# port: 25 # port: "25"
# user: user1 # user: user1
# password: Pa$$w0rd # password: Pa$$w0rd
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
- name: Configure SMTP relay - name: Configure SMTP relay
ansible.builtin.include_tasks: smtp_relay.yml ansible.builtin.include_tasks: smtp_relay.yml
loop: "{{ ynh_new_smtp_relay | dict2items }}" loop: "{{ ynh_smtp_relay | dict2items }}"
when: item.value when: item.value
- name: Add Yunohost users - name: Add Yunohost users
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment