Add script dovecot-service-checksuspended.
This commit is contained in:
parent
b5c67996f9
commit
f330b6b06e
2 changed files with 24 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
# Darren 'Tadgy' Austin <darren (at) afterdark.org.uk>
|
# Darren 'Tadgy' Austin <darren (at) afterdark.org.uk>
|
||||||
# Licensed under the terms of the GNU General Public License version 3.
|
# Licensed under the terms of the GNU General Public License version 3.
|
||||||
#
|
#
|
||||||
|
# Colourise the Slackware ChangeLog and, optionally, 'watch' it for changes.
|
||||||
# Best run in a screen or tmux window with activity monitoring turned on, so you get a notification any time the ChangeLog is updated.
|
# Best run in a screen or tmux window with activity monitoring turned on, so you get a notification any time the ChangeLog is updated.
|
||||||
|
|
||||||
# Defaults.
|
# Defaults.
|
||||||
|
|
|
||||||
23
dovecot-service-checksuspended
Executable file
23
dovecot-service-checksuspended
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Version: 0.0.1
|
||||||
|
# Copyright (c) 2023:
|
||||||
|
# Darren 'Tadgy' Austin <darren (at) afterdark.org.uk>
|
||||||
|
# Licensed under the terms of the GNU General Public License version 3.
|
||||||
|
#
|
||||||
|
# A Dovecot service script to check whether a domain or user has been suspended from being able to use mail.
|
||||||
|
|
||||||
|
VIRTUAL_DIR="/etc/virtual"
|
||||||
|
U="${USER%%@*}"
|
||||||
|
D="${USER#*@}"
|
||||||
|
|
||||||
|
[[ -e "$VIRTUAL_DIR/$D/suspended" ]] && {
|
||||||
|
printf "* %s\\r\\n" "NO [ALERT] Domain suspended"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ -e "$VIRTUAL_DIR/$D/$U/suspended" ]] && {
|
||||||
|
printf "* %s\\r\\n" "NO [ALERT] User suspended"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue