# 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:** 1
**Showing post:** 18

<div class="post-metadata">

### Author: ![Poine](https://forum.yunohost.org/user_avatar/forum.yunohost.org/poine/32/3128_2.png) [@Poine](https://forum.yunohost.org/u/Poine)
#### Post date: [January 31, 2023, 10:23pm UTC](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235/18 "2023-01-31T22:23:11Z")

</div>

Bonjour, j’ai tenté de créer un hook pour modifier les fichiers /etc/postfix/main.cf et /etc/postfix/master.cf afin de ralentir les envois vers certains serveurs comme [orange.fr](http://orange.fr)  
Est-ce que ça vous semble correct?

```auto
#!/bin/bash

# Avant tout j ai créé un fichier /etc/postfix/transport listant les serveurs pour lesquels je veux ralentir l envoi:
# orange.fr slow;
# free.fr slow;
# domain.tld slow;

action=$1
pending_dir=$4
postfix_main_conf=$pending_dir/../postfix/etc/postfix/main.cf
postfix_master_conf=$pending_dir/../postfix/etc/postfix/master.cf

[["$action" == "pre"]] || exit 0
[[-e $postfix_main_conf]] || exit 0
[[-e $postfix_master_conf]] || exit 0

echo '
transport_maps = hash:/etc/postfix/transport
slow_initial_destination_concurrency=1
slow_destination_concurrency_limit=1
slow_destination_rate_delay=5' >> $postfix_main_conf

echo '
slow unix - - n - 5 smtp
   -o syslog_name=postfix-slow
   -o smtp_destination_concurrency_limit=1
   -o slow_destination_rate_delay=5' >> $postfix_master_conf

```

---

_[View the full topic](https://forum.yunohost.org/t/share-your-hooks-to-apply-custom-configurations-partagez-vos-hooks-pour-appliquer-des-configurations-personnelles/17235)._
