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

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
Est-ce que ça vous semble correct?

#!/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