Skip to content

Commit 71303b3

Browse files
author
Kristan Kenney
committed
Merge branch 'feature/v-delete-sys-mail-queue' into feature/user-roles
2 parents 62ce4d6 + f0de170 commit 71303b3

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

bin/v-add-mail-domain-webmail

100644100755
File mode changed.

bin/v-delete-sys-mail-queue

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
# info: delete exim mail queue
3+
# options: none
4+
# labels: hestia
5+
#
6+
# example: v-delete-sys-mail-queue
7+
#
8+
# This function checks for messages stuck in the exim mail queue
9+
# and prompts the user to clear the queue if desired.
10+
11+
#----------------------------------------------------------#
12+
# Variable&Function #
13+
#----------------------------------------------------------#
14+
15+
# Includes
16+
# shellcheck source=/usr/local/hestia/func/main.sh
17+
source $HESTIA/func/main.sh
18+
# shellcheck source=/usr/local/hestia/conf/hestia.conf
19+
source $HESTIA/conf/hestia.conf
20+
21+
22+
# Perform verification if read-only mode is enabled
23+
check_hestia_demo_mode
24+
25+
message_count=$(exim -bpc)
26+
#----------------------------------------------------------#
27+
# Action #
28+
#----------------------------------------------------------#
29+
30+
if [ "$message_count" -gt 0 ]; then
31+
read -p "Are you sure you want to delete $message_count messages from the exim queue? [y/N] " answer
32+
33+
if [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
34+
exiqgrep -i | xargs exim -Mrm
35+
fi
36+
fi
37+
#----------------------------------------------------------#
38+
# Hestia #
39+
#----------------------------------------------------------#
40+
$BIN/v-log-action "system" "Info" "System" "Package copied (Package: $package, New Package: $new_package)."
41+
log_event "$OK" "$ARGUMENTS"
42+
43+
exit

0 commit comments

Comments
 (0)