From f330b6b06e101408ff2efced68d70c7c24285f1b Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Sun, 29 Oct 2023 17:08:54 +0000 Subject: [PATCH] Add script dovecot-service-checksuspended. --- colour-changelog | 1 + dovecot-service-checksuspended | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 dovecot-service-checksuspended diff --git a/colour-changelog b/colour-changelog index 5f227f7..92e6233 100755 --- a/colour-changelog +++ b/colour-changelog @@ -5,6 +5,7 @@ # Darren 'Tadgy' Austin # 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. # Defaults. diff --git a/dovecot-service-checksuspended b/dovecot-service-checksuspended new file mode 100755 index 0000000..cd9181f --- /dev/null +++ b/dovecot-service-checksuspended @@ -0,0 +1,23 @@ +#!/bin/bash +# Version: 0.0.1 +# Copyright (c) 2023: +# Darren 'Tadgy' Austin +# 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 "$@"