# Share your "hooks" to apply custom configurations- Partagez vos "hooks" pour appliquer des configurations personnelles

**URL:** <https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235>\
**Category:** Tutorials\
**Tags:** french, english\
**Created:** [September 20, 2021, 9:36pm UTC](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235 "2021-09-20T21:36:03Z")\
**Posts on this page:** 8\
**Page:** 5

<div class="post-metadata">

**Author:** ![metyun](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/f14d63/32.png) [@metyun](https://forum.yunohost.org/u/metyun)\
**Post date:** [February 16, 2026, 6:59pm UTC](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235/81 "2026-02-16T18:59:58Z")

</div>

For information Fail2ban read the files in alphabetical order in this folder. If you have a file jail-perso.conf and another zen.conf with identical parameter, zen.conf erase the jail-perso.conf parameter. You can use this to add parameters or erase yunohost parameters without hook.

---

<div class="post-metadata">

**Author:** ![Kit](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kit/32/1208_2.png) [@Kit](https://forum.yunohost.org/u/Kit)\
**Post date:** [February 17, 2026, 8:59pm UTC](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235/82 "2026-02-17T20:59:27Z")

</div>

Good to know, however I like hooks to easily restore or install yunohost servers (including tons of config files everywhere).

---

<div class="post-metadata">

**Author:** ![metyun](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/f14d63/32.png) [@metyun](https://forum.yunohost.org/u/metyun)\
**Post date:** [February 17, 2026, 10:00pm UTC](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235/83 "2026-02-17T22:00:49Z")

</div>

I use conf\_regen hooks too but i use customs jails in /etc/fail2ban/jail.d before use them . I don’t write hook to replace them and I use /etc/yunohost/hooks.d/backup/99-conf\_custom (and the restore file too) to save/restore them and many additionals files. Use conf\_regen hooks to modify config file and backup hook 99-conf\_custom to save all types of files is a great combination 👍

> **[Include or exclude files | Yunohost](https://doc.yunohost.org/admin/backups/include_exclude_files/)**
>
> Include files

---

<div class="post-metadata">

**Author:** ![Krakinou](https://forum.yunohost.org/user_avatar/forum.yunohost.org/krakinou/32/1702_2.png) [@Krakinou](https://forum.yunohost.org/u/Krakinou)\
**Post date:** [February 18, 2026, 9:12am UTC](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235/84 "2026-02-18T09:12:17Z")

</div>

Yes, I do the same. And a few days ago, I noticed [this app](https://github.com/YunoHost-Apps/custom_backup_ynh) that allows to add custom path/files to the backup without managing the hook ourselves.

I did not test it yet, but it may be quite handy.

---

<div class="post-metadata">

**Author:** ![dalecooper](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/d/5daacb/32.png) [@dalecooper](https://forum.yunohost.org/u/dalecooper)\
**Post date:** [June 15, 2026, 11:23pm UTC](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235/85 "2026-06-15T23:23:25Z")

</div>

also modify

`sed -i \'/smtpd_recipient_restrictions/a\ ….`

with (note `/i` instead of `/a` )

`sed -i '/reject_non_fqdn_recipient,/i\`…

to make sure this gets applied **after** your default rules.

---

<div class="post-metadata">

**Author:** ![metyun](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/f14d63/32.png) [@metyun](https://forum.yunohost.org/u/metyun)\
**Post date:** [June 16, 2026, 5:48pm UTC](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235/86 "2026-06-16T17:48:10Z")

</div>

The hook only do what the documentation on spamhaus says :

> We recommend putting these lines at the top of the smtpd\_recipient\_restrictions section.

Could you explain why the hook should’nt follow the spamhaus documentation?  
I notice that a change was made since i post the hook, the las tline is now at the first place and [2..255] was changed with [2.11] , i don’t know the consequence of this change or if the first recommendation is still valid.

---

<div class="post-metadata">

**Author:** ![dalecooper](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/d/5daacb/32.png) [@dalecooper](https://forum.yunohost.org/u/dalecooper)\
**Post date:** [June 17, 2026, 2:40pm UTC](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235/87 "2026-06-17T14:40:51Z")

</div>

with the `/a` version, you will insert the spamhaus rules before these two lines:

`smtpd_recipient_restrictions =￼`  
` permit_mynetworks,￼`  
` permit_sasl_authenticated,￼`

and rules are applied in order. Which means messages sent from your local server or properly authenticated will go through the spamhaus filters for no reason. On my setup, this has sometimes very unpredictably prevented me from sending emails.

The modified version makes sure to preserve the rules order with the two `permit `lines first.

---

<div class="post-metadata">

**Author:** ![metyun](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/f14d63/32.png) [@metyun](https://forum.yunohost.org/u/metyun)\
**Post date:** [June 30, 2026, 9:40pm UTC](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235/89 "2026-06-30T21:40:10Z")

</div>

> [@pufejomu](#):
>
> If YunoHost has added new settings since then, do share those too!

You could use this command to list all the settings

```auto
yunohost settings list

```

[Previous page](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235.md?page=4)
