whitelist_mb_google_sigs.sh/whitelist_mb_sigs.sh: fix error in detecting signaur of infected e-mails.

This commit is contained in:
Christoph 2021-01-18 14:39:10 +01:00
parent c07f1c29ba
commit 7cf626d6fa
2 changed files with 8 additions and 6 deletions

View File

@ -305,13 +305,13 @@ fi
blank_line blank_line
declare -a google_sig_arr=()
declare -A virus_emails=()
if [[ -z "$found_sigs" ]]; then if [[ -z "$found_sigs" ]]; then
if $terminal ; then if $terminal ; then
echononl "\033[33mNo quarantined e-mails with \033[1mMBL_*\033[ signatures found.\033[m\n" echononl "\033[33mNo quarantined e-mails with \033[1mMBL_*\033[ signatures found.\033[m\n"
fi fi
else else
declare -a google_sig_arr=()
declare -A virus_emails=()
_failed=false _failed=false
for _sig in $found_sigs ; do for _sig in $found_sigs ; do
if $(sigtool --find-sigs=$_sig | sigtool --decode-sigs | grep -q "google.com" 2> $log_file) ; then 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 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 | 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 for _email in $_emails ; do
_email="${_email#"${QUARANTINE_BASE_DIR}/virus/"}" _email="${_email#"${QUARANTINE_BASE_DIR}/virus/"}"
echononl "Add \033[1m$_email\033[m with signatur \033[1m$_sig\033[m to list.." echononl "Add \033[1m$_email\033[m with signatur \033[1m$_sig\033[m to list.."

View File

@ -316,13 +316,13 @@ fi
blank_line blank_line
declare -a whitelist_sig_arr=()
declare -A virus_emails=()
if [[ -z "$found_sigs" ]]; then if [[ -z "$found_sigs" ]]; then
if $terminal ; then if $terminal ; then
echononl "\033[33mNo quarantined e-mails with \033[1mMBL_*\033[ signatures found.\033[m\n" echononl "\033[33mNo quarantined e-mails with \033[1mMBL_*\033[ signatures found.\033[m\n"
fi fi
else else
declare -a whitelist_sig_arr=()
declare -A virus_emails=()
_failed=false _failed=false
for _sig in $found_sigs ; do for _sig in $found_sigs ; do
for _str in ${whitelist_string_arr[@]} ; do for _str in ${whitelist_string_arr[@]} ; do
@ -387,7 +387,8 @@ fi
for _sig in ${whitelist_sig_arr[@]}; do 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 | 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 for _email in $_emails ; do
_email="${_email#"${QUARANTINE_BASE_DIR}/virus/"}" _email="${_email#"${QUARANTINE_BASE_DIR}/virus/"}"
echononl "Add \033[1m$_email\033[m with signatur \033[1m$_sig\033[m to list.." echononl "Add \033[1m$_email\033[m with signatur \033[1m$_sig\033[m to list.."