This repository has been archived on 2021-02-06. You can view files and clone it, but cannot push or open issues/pull-requests.
mail/postfix/scripts/map-hotplug.sh

8 lines
308 B
Bash
Executable File

#!/bin/sh
if [ "$1" == "c" ] && [ "$2" == "/etc/postfix/hotplug.d/" ] && ([ "$3" == "virtual" ] || [ "$3" == "access_sender" ]); then
cp "/etc/postfix/hotplug.d/$3" "/etc/postfix/$3"
chown root:root "/etc/postfix/$3"
postmap "/etc/postfix/$3"
echo "$(date +"%b %d %H:%M:%H"): remapped $3"
fi