Fix: Double arithmetic syntax error in generate_comparison_report (line 2073)

This commit is contained in:
Developer
2026-04-23 21:16:33 -04:00
parent 8af1ca881b
commit ca7ec62e02
12 changed files with 121 additions and 70 deletions
+7 -5
View File
@@ -419,7 +419,8 @@ if [ "$sent" -gt 0 ] || [ "$received" -gt 0 ]; then
# Top recipients (delivery recipients from emails in TEMP_MATCHES)
if [ "$sent" -gt 0 ] || [ "$delivered" -gt 0 ]; then
print_info "Top 5 recipients (emails delivered TO):"
grep -F "$search_pattern" "$TEMP_MATCHES" 2>/dev/null | grep -oE "=> [^@]+@[^ ]+" | sed 's/=> //' | sort | uniq -c | sort -rn | head -5 | while read count recipient; do
sed -n "/^$search_pattern/p" "$TEMP_MATCHES" 2>/dev/null | \
sed -n 's/.*=> \([^@]*@[^ ]*\).*/\1/p' | sort | uniq -c | sort -rn | head -5 | while read count recipient; do
[ -n "$count" ] && echo " $recipient - $count emails"
done
echo ""
@@ -428,7 +429,8 @@ if [ "$sent" -gt 0 ] || [ "$received" -gt 0 ]; then
# Top senders (who is sending emails in TEMP_MATCHES)
if [ "$sent" -gt 0 ]; then
print_info "Top 5 senders (emails sent FROM):"
grep -F "$search_pattern" "$TEMP_MATCHES" 2>/dev/null | grep -oE "<= [^@]+@[^ ]+" | sed 's/<= //' | sort | uniq -c | sort -rn | head -5 | while read count sender; do
sed -n "/^$search_pattern/p" "$TEMP_MATCHES" 2>/dev/null | \
sed -n 's/.*<= \([^@]*@[^ ]*\).*/\1/p' | sort | uniq -c | sort -rn | head -5 | while read count sender; do
[ -n "$count" ] && echo " $sender - $count emails"
done
echo ""
@@ -546,7 +548,7 @@ if [ "$check_type" != "2" ]; then
# cPanel forwarders (in /etc/valiases)
if [ -f "/etc/valiases/$domain_part" ]; then
forwarder=$(grep -F "^$local_part:" "/etc/valiases/$domain_part" 2>/dev/null)
forwarder=$(grep "^${local_part}:" "/etc/valiases/$domain_part" 2>/dev/null || echo "")
if [ -n "$forwarder" ]; then
echo ""
print_info "Forwarder configured:"
@@ -650,7 +652,7 @@ if [ "$delivered" -gt 0 ]; then
else
echo " $line"
fi
done < <(grep -F "$search_pattern" "$TEMP_MATCHES" | grep -iE "=>|delivered" | tail -5)
done < <(sed -n "/^$search_pattern/p" "$TEMP_MATCHES" 2>/dev/null | sed -n '/=>\|[Dd]elivered/p' | tail -5)
echo ""
fi
@@ -660,7 +662,7 @@ if [ "$bounced" -gt 0 ]; then
# Get all bounce lines (Issue 4.1: add -- after grep flags)
TEMP_BOUNCES="/tmp/email_bounces_$$.txt"
grep -F -- "$search_pattern" "$TEMP_MATCHES" 2>/dev/null | \
sed -n "/^$search_pattern/p" "$TEMP_MATCHES" 2>/dev/null | \
grep -Ev "authenticator failed|Authentication failed|saved mail to|=>" | \
grep -iE "550|551|552|553|554|bounced|Mail delivery failed|\\*\\* " > "$TEMP_BOUNCES" 2>/dev/null