Files
hestiacp/bin/v-list-sys-mail-status

54 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2024-03-19 22:05:27 +03:00
#!/bin/bash
# info: list mail status
# options:
#
# example: v-list-sys-mail-status
#
# This function lists mail server status
#----------------------------------------------------------#
# Variables & Functions #
#----------------------------------------------------------#
# Argument definition
#format=${1-shell}
# Includes
# shellcheck source=/etc/hestiacp/hestia.conf
source /etc/hestiacp/hestia.conf
# shellcheck source=/usr/local/hestia/func/main.sh
source $HESTIA/func/main.sh
# shellcheck source=/usr/local/hestia/conf/hestia.conf
source $HESTIA/conf/hestia.conf
# load config file
source_conf "$HESTIA/conf/hestia.conf"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Checking mail system
if [ -z "$MAIL_SYSTEM" ]; then
exit
fi
# Displaying exim queue status
echo "Exim queue status"
exim -bp
echo -en "\n---------------------------------------------"
echo -en "---------------------------------------------\n\n"
# Displaying exim stats
2026-08-10 21:41:37 +03:00
eximstats /var/log/exim/main.log 2> /dev/null
2024-03-19 22:05:27 +03:00
if [ $? -ne 0 ]; then
2026-08-10 21:41:37 +03:00
echo "[Exim] No valid log lines read"
2024-03-19 22:05:27 +03:00
exit 0
fi
#----------------------------------------------------------#
# Hestia #
#----------------------------------------------------------#
exit 0