Customize additional config for postfix's main.cf

I’ve added the following hook in /etc/yunohost/hooks.d/conf_regen/20-postfix_smtp_address_preference_ipv4:

#!/bin/bash

# Sets IPv4 preferred on outgoing mail to avoid IPv6 blacklisting

action=$1
pending_dir=$4
postfix_conf=$pending_dir/../postfix/etc/postfix/main.cf

[[ "$action" == "pre" ]] || exit 0
[[ -e $postfix_conf ]] || exit 0
echo '

# ipv4 preferred on outgoing mail to avoid IPv6 blacklisting
smtp_address_preference = ipv4
' >> $postfix_conf

Applying yunohost tools regen-conf -n -d postfix to check if that suits you, and yunohost tools regen-conf --force postfix whenever ready to apply

Not sure if that config is to be recommended, but at least it won’t mess with the rest of the updates of the postfix config, for me.