From 3c26b8b04baa131e572f62f4fcedcc798c10f1b4 Mon Sep 17 00:00:00 2001 From: didier Date: Sun, 15 Mar 2026 11:50:08 +0100 Subject: [PATCH] ajout du test mail valide --- bin/interoPaheko.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/interoPaheko.sh b/bin/interoPaheko.sh index 571188e..63176bb 100755 --- a/bin/interoPaheko.sh +++ b/bin/interoPaheko.sh @@ -21,6 +21,7 @@ FILE_CREATEUSER="$KAZ_ROOT/tmp/createUser.txt" FILE_NOTIFICATION="${KAZ_TEMP_DIR}/${PRG}.txt" sep=' ' ERRMSG="" +regexMail="^(([A-Za-z0-9]+((\.|\-|\_|\+)?[A-Za-z0-9]?)*[A-Za-z0-9]+)|[A-Za-z0-9]+)@(([A-Za-z0-9]+)+((\.|\-|\_)?([A-Za-z0-9]+)+)*)+\.([A-Za-z]{2,})+$" ############################################ Fonctions ####################################################### TEXTE=" @@ -93,6 +94,8 @@ Int_paheko_Action() { ################################ # test du mail valide en $domain : si oui on remplie la variable ERRMSG et on créé le fichier de notification" echo ${email} | grep -i "${domain}" >/dev/null || { ERRMSG="- Le mail ${email} n'est pas en ${domain}";touch ${FILE_NOTIFICATION} 2>/dev/null;} + # test de la validité du mail + [[ ${email} =~ ${regexMail} ]] || ERRMSG="${ERRMSG} - Le mail ${email} n'est pas valide" ################################ #on compte le nom de champs dans la zone nom pour gérer les noms et prénoms composés # si il y a 3 champs, on associe les 2 premieres valeurs avec un - et on laisse le 3ème identique