Browse Source

fix_dkim_global_on

main
pvincent 3 weeks ago
parent
commit
fc7deda58a
  1. 7
      .vscode/settings.json
  2. 30
      sympa/miaou/miaou-install-from-import-sympa
  3. 27
      sympa/recipe/sympa_fix_dkim_global_on.recipe

7
.vscode/settings.json

@ -18,5 +18,10 @@
"**/*.md", "**/*.md",
"**/sympa/miaou/*", "**/sympa/miaou/*",
"**/*.sh" "**/*.sh"
]
],
"bashIde.shfmt.simplifyCode": true,
"bashIde.shfmt.spaceRedirects": true,
"bashIde.shfmt.languageDialect": "bash",
"bashIde.shfmt.binaryNextLine": true,
"bashIde.shfmt.caseIndent": true
} }

30
sympa/miaou/miaou-install-from-import-sympa

@ -15,18 +15,18 @@ function usage {
function parse_options { function parse_options {
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
--help | -h)
usage && exit 0
;;
*)
if [[ -z $CONTAINER ]]; then
CONTAINER=$1
elif [[ -z $IMPORT_FILE ]]; then
IMPORT_FILE=$1
else
echo >&2 "Unknown option: $1" && usage && exit 2
fi
;;
--help | -h)
usage && exit 0
;;
*)
if [[ -z $CONTAINER ]]; then
CONTAINER=$1
elif [[ -z $IMPORT_FILE ]]; then
IMPORT_FILE=$1
else
echo >&2 "Unknown option: $1" && usage && exit 2
fi
;;
esac esac
shift 1 # Move to the next argument shift 1 # Move to the next argument
@ -52,6 +52,11 @@ function fix_dmarc_off {
miaou-recipe "$CONTAINER" "$BASEDIR"/../recipe/sympa_fix_dmarc_off.recipe miaou-recipe "$CONTAINER" "$BASEDIR"/../recipe/sympa_fix_dmarc_off.recipe
} }
function fix_dkim_global_on {
echo 'fix dkim global on...'
miaou-recipe "$CONTAINER" "$BASEDIR"/../recipe/sympa_fix_dkim_global_on.recipe
}
# MAIN # MAIN
set -Eue set -Eue
@ -67,4 +72,5 @@ echo "launch the import process"
miaou-exec $CONTAINER -- /opt/miaou-sympa/tools/sympa_import.bash "/root/$import_base" miaou-exec $CONTAINER -- /opt/miaou-sympa/tools/sympa_import.bash "/root/$import_base"
fix_dmarc_off fix_dmarc_off
fix_dkim_global_on
install_fake_additional install_fake_additional

27
sympa/recipe/sympa_fix_dkim_global_on.recipe

@ -0,0 +1,27 @@
#!/usr/bin/env miaou-recipe
# CONSTANTS
GLOBAL_CONF=/etc/sympa/sympa/sympa.conf
# FUNCTIONS
function fix_dkim_global_on {
if ! grep -q "^dkim_feature[[:space:]]*on" $GLOBAL_CONF; then
local sympa_domain=$(grep '^domain' "$GLOBAL_CONF" | cut -f2)
/opt/miaou-bash/tools/append_or_replace "^dkim_feature.*$" 'dkim_feature on' $GLOBAL_CONF
/opt/miaou-bash/tools/append_or_replace "^dkim_signature_apply_on.*$" 'dkim_signature_apply_on any' $GLOBAL_CONF
/opt/miaou-bash/tools/append_or_replace "^dkim_parameters.private_key_path.*$" 'dkim_parameters.private_key_path /etc/dkimkeys/mail.private' $GLOBAL_CONF
/opt/miaou-bash/tools/append_or_replace "^dkim_parameters.selector.*$" 'dkim_parameters.selector mail' $GLOBAL_CONF
/opt/miaou-bash/tools/append_or_replace "^dkim_parameters.signer_domain.*$" "dkim_parameters.signer_domain $sympa_domain" $GLOBAL_CONF
systemctl restart wwsympa.socket
echo 'dkim feature now enabled'
else
echo 'dkim feature already enabled globally!'
fi
}
# MAIN
set -Eue
fix_dkim_global_on
Loading…
Cancel
Save