From 7cf626d6faa1ac13e239afda2ccfaf02f8111240 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 18 Jan 2021 14:39:10 +0100 Subject: [PATCH] whitelist_mb_google_sigs.sh/whitelist_mb_sigs.sh: fix error in detecting signaur of infected e-mails. --- whitelist_mb_google_sigs.sh | 7 ++++--- whitelist_mb_sigs.sh | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/whitelist_mb_google_sigs.sh b/whitelist_mb_google_sigs.sh index e01439c..045dbdf 100755 --- a/whitelist_mb_google_sigs.sh +++ b/whitelist_mb_google_sigs.sh @@ -305,13 +305,13 @@ fi blank_line +declare -a google_sig_arr=() +declare -A virus_emails=() if [[ -z "$found_sigs" ]]; then if $terminal ; then echononl "\033[33mNo quarantined e-mails with \033[1mMBL_*\033[ signatures found.\033[m\n" fi else - declare -a google_sig_arr=() - declare -A virus_emails=() _failed=false for _sig in $found_sigs ; do if $(sigtool --find-sigs=$_sig | sigtool --decode-sigs | grep -q "google.com" 2> $log_file) ; then @@ -374,7 +374,8 @@ fi for _sig in ${google_sig_arr[@]}; do #_emails="$(grep INFECTED ${Q_VIRUS_DIR}/* | grep "$_sig" | cut -d ':' -f1 | sed -e "s#^${QUARANTINE_BASE_DIR}/##")" - _emails="$(grep INFECTED ${Q_VIRUS_DIR}/* | grep "$_sig" | cut -d ':' -f1)" + #_emails="$(grep INFECTED ${Q_VIRUS_DIR}/* | grep "$_sig" | cut -d ':' -f1)" + _emails="$(grep "$_sig" ${Q_VIRUS_DIR}/* | cut -d ':' -f1)" for _email in $_emails ; do _email="${_email#"${QUARANTINE_BASE_DIR}/virus/"}" echononl "Add \033[1m$_email\033[m with signatur \033[1m$_sig\033[m to list.." diff --git a/whitelist_mb_sigs.sh b/whitelist_mb_sigs.sh index 3a45b0c..6774f5b 100755 --- a/whitelist_mb_sigs.sh +++ b/whitelist_mb_sigs.sh @@ -316,13 +316,13 @@ fi blank_line +declare -a whitelist_sig_arr=() +declare -A virus_emails=() if [[ -z "$found_sigs" ]]; then if $terminal ; then echononl "\033[33mNo quarantined e-mails with \033[1mMBL_*\033[ signatures found.\033[m\n" fi else - declare -a whitelist_sig_arr=() - declare -A virus_emails=() _failed=false for _sig in $found_sigs ; do for _str in ${whitelist_string_arr[@]} ; do @@ -387,7 +387,8 @@ fi for _sig in ${whitelist_sig_arr[@]}; do #_emails="$(grep INFECTED ${Q_VIRUS_DIR}/* | grep "$_sig" | cut -d ':' -f1 | sed -e "s#^${QUARANTINE_BASE_DIR}/##")" - _emails="$(grep INFECTED ${Q_VIRUS_DIR}/* | grep "$_sig" | cut -d ':' -f1)" + #_emails="$(grep INFECTED ${Q_VIRUS_DIR}/* | grep "$_sig" | cut -d ':' -f1)" + _emails="$(grep "$_sig" ${Q_VIRUS_DIR}/* | cut -d ':' -f1)" for _email in $_emails ; do _email="${_email#"${QUARANTINE_BASE_DIR}/virus/"}" echononl "Add \033[1m$_email\033[m with signatur \033[1m$_sig\033[m to list.."