5b639a345f
Created modules: - blacklist-check.sh - Check IP blacklists (functional) - mail-queue-inspector.sh - View mail queue (functional) - deliverability-test.sh - Email delivery test (stub) - smtp-connection-test.sh - SMTP connection test (stub) - spf-dkim-dmarc-check.sh - Authentication check (stub) - flush-mail-queue.sh - Clear mail queue (stub) - clean-mailboxes.sh - Mailbox cleanup (stub) Fixes: Email menu now shows all options instead of 'module not found' errors Status: 3 functional, 4 stubs marked 'under development'
69 lines
1.8 KiB
Bash
Executable File
69 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
################################################################################
|
|
# Mail Queue Inspector
|
|
################################################################################
|
|
# Purpose: View and analyze mail queue
|
|
################################################################################
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
source "$SCRIPT_DIR/lib/common-functions.sh"
|
|
source "$SCRIPT_DIR/lib/system-detect.sh"
|
|
source "$SCRIPT_DIR/lib/email-functions.sh"
|
|
|
|
show_banner "Mail Queue Inspector"
|
|
|
|
# Detect MTA
|
|
MTA=$(detect_mta)
|
|
|
|
if [ "$MTA" = "unknown" ]; then
|
|
print_error "No supported mail server (Exim/Postfix) detected"
|
|
exit 1
|
|
fi
|
|
|
|
print_info "Detected mail server: $MTA"
|
|
echo ""
|
|
|
|
# Show queue summary
|
|
if [ "$MTA" = "exim" ]; then
|
|
print_header "Queue Summary"
|
|
exim -bpc | while read count; do
|
|
if [ "$count" -gt 0 ]; then
|
|
print_warning "$count messages in queue"
|
|
else
|
|
print_success "Mail queue is empty"
|
|
fi
|
|
done
|
|
echo ""
|
|
|
|
# Show queue details if not empty
|
|
queue_count=$(exim -bpc)
|
|
if [ "$queue_count" -gt 0 ]; then
|
|
print_header "Recent Queue Messages (last 20)"
|
|
exim -bp | head -40
|
|
echo ""
|
|
|
|
print_header "Frozen Messages"
|
|
frozen=$(exim -bp | grep frozen | wc -l)
|
|
if [ "$frozen" -gt 0 ]; then
|
|
print_warning "$frozen frozen messages found"
|
|
exim -bp | grep frozen | head -10
|
|
else
|
|
print_success "No frozen messages"
|
|
fi
|
|
fi
|
|
|
|
elif [ "$MTA" = "postfix" ]; then
|
|
print_header "Queue Summary"
|
|
mailq | tail -1
|
|
echo ""
|
|
|
|
print_header "Queue Details"
|
|
mailq | head -50
|
|
fi
|
|
|
|
echo ""
|
|
print_info "Use 'exim -Mvl <message_id>' to view message details"
|
|
print_info "Use 'exim -Mrm <message_id>' to remove a message"
|
|
echo ""
|